使用 Abaqus 创建带草图的曲面 Python

Creating a surface with a sketch using Abaqus Python

我的问题听起来很简单,但我对 Abaqus 脚本的知识几乎一无所知。我的目标是在同一部件中表示一组多边形,其中每个多边形表示部件的 2D 表面(在 3D space 中)。 我正在创建一个脚本来为每个多边形生成草图(不确定这是否是最佳方法)。然后为每个草图创建一个表面。

我怎样才能做到这一点?

非常感谢!

代码:

from abaqus import *
from abaqusConstants import *
import sketch
import part

MyModel=mdb.Model(name='Model-1')


#-------------FIRST POLYGON------------------------------- 
s1=MyModel.ConstrainedSketch(name='__poly0__', sheetSize=100)

g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints

s1.Line(point1=(10.0, 10.0), point2=(10.0, 15.0))
s1.Line(point1=(10.0, 15.0), point2=(-10.0, 15.0))
s1.Line(point1=(-10.0, 15.0), point2=(-10.0, -15.0))
s1.Line(point1=(-10.0, -15.0), point2=(10.0, -15.0))
s1.Line(point1=(10.0, -15.0), point2=(10.0, -10.0))
s1.Line(point1=(10.0, -10.0), point2=(5, 0))
s1.Line(point1=(5, 0), point2=(10.0, 10.0))

#-------------SECOND POLYGON-------------------------------
s2=MyModel.ConstrainedSketch(name='__poly1__', sheetSize=100)

g, v, d, c = s2.geometry, s2.vertices, s2.dimensions, s2.constraints

s2.Line(point1=(10.0, 10.0), point2=(5, 0))
s2.Line(point1=(5, 0), point2=(10.0, -10.0))
s2.Line(point1=(10.0, -10.0), point2=(10.0, -15.0))
s2.Line(point1=(10.0, -15.0), point2=(15.0, -15.0))
s2.Line(point1=(15.0, -15.0), point2=(15.0, 0.0))
s2.Line(point1=(15.0, 0.0), point2=(10, 10))

#----------ONE PART WITH TWO PLANAR FACES (ONE PER POLYGON)-----
p = mdb.models['Model-1'].Part(name='Part-1', dimensionality=THREE_D,type=DEFORMABLE_BODY)
p = mdb.models['Model-1'].parts['Part-1']

#How can I put two planar faces here?

#First Polygon
#p.BaseShell(sketch=s1)
#del mdb.models['Model-1'].sketches['__poly0__']

#Second Polygon
#p.BaseShell(sketch=s2)
#del mdb.models['Model-1'].sketches['__poly1__']

#-------------------------------------------------------------

表面可能意味着两件事。通常在 Abaqus 术语中,表面是指零件或组件的面或边。它通常并不意味着平坦的部分。在 Abaqus 之外,创建曲面可以理解为创建平面零件。

这是一个像您这样的代码,它在 3D 中制作零件 space(2D 零件只有 Abaqus SURFACES 意义上的边)。然后它在 2 个面之一上创建 Abaqus SURFACE。

from abaqus import *
from abaqusConstants import *

s1 = mdb.models['Model-1'].ConstrainedSketch(name='__profile__',sheetSize=200.0)
g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints
s1.Line(point1=(-21.25, 22.5), point2=(-33.75, -20.0))
s1.Line(point1=(-33.75, -20.0), point2=(-3.75, -32.5))
s1.Line(point1=(-3.75, -32.5), point2=(40.0, -25.0))
s1.Line(point1=(40.0, -25.0), point2=(25.0, 25.0))
s1.Line(point1=(25.0, 25.0), point2=(-21.25, 22.5))

#this creates the actual part - which is a planar surface that exists in 3D space
p = mdb.models['Model-1'].Part(name='Part-2', dimensionality=THREE_D,type=DEFORMABLE_BODY)

p = mdb.models['Model-1'].parts['Part-2']

p.BaseShell(sketch=s1)
del mdb.models['Model-1'].sketches['__profile__']


#the following finds and creates a "surface" on the part. 
f = p.faces
face=f.findAt(coordinates=(0.0,0.0,0.0))
face_ind=face.index
side1Faces=f[face_ind:face_ind+1]

p.Surface(side1Faces=side1Faces, name='Surf-1')

如果这不是您要问的问题,请在您的问题中进行更多解释。