BenTUM
Mechanical
- Oct 1, 2013
- 2
Dear engineering community,
for a tape laying process (Heat Transfer Analysis) I want to sweep a sketch along a curve using python.
But I do not want to create one whole tape/ply, but a chaine of segments along the curve.
The purpose of that is, that I want to model the laying down of the tape by simply moving
the tape segments, which are hidden under the mould, with '*Motion' onto the surface of the mould.
But therefore I have to reference little segments of the tape.
I already wrote a small function for creating segments along a straight line:
def StraightCurve(modelName, start, stop, num_seg, width):
length = stop[0]-start[0]
length_segment = length/num_seg
##
for i in range(step):
# curve
s = mdb.models[modelName].ConstrainedSketch(name='__sweep__',
sheetSize=200.0, transform=[1.0, 0.0, 0.0, 0.0, 0, -1.0, 0.0, 1, 0, 0, 0,0])
g, v, d, c = s.geometry, s.vertices, s.dimensions, s.constraints
s.Line(point1=(start[0]+i*length_segment, start[2]), point2=(start[0]+(i+1)*length_segment, start[2]))
## Tapebreite
s1 = mdb.models[modelName].ConstrainedSketch(name='__profile__',
sheetSize=200.0, transform=(0.0, 0, 1.0, 0.0, 1.0, 0.0, -1.0, 0.0, 1.0, length_segment*i, 0.0, 0.0))
g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints
s1.Line(point1=(-width/2, 20), point2=(width/2,20))
##
p = mdb.models[modelName].Part(name='Segment_%i'%i, dimensionality=THREE_D,
type=DEFORMABLE_BODY)
p.BaseShellSweep(sketch=s1, path=s)
s1.unsetPrimaryObject()
p = mdb.models[modelName].parts['Segment_%i'%i]
del mdb.models[modelName].sketches['__profile__']
del mdb.models[modelName].sketches['__sweep__']
##
If you have any ideas how to create points along a curve in a certain intervall
or you got any other idea how to cerate shell segments along a curve please let me know!
Thanks
Benedikt
for a tape laying process (Heat Transfer Analysis) I want to sweep a sketch along a curve using python.
But I do not want to create one whole tape/ply, but a chaine of segments along the curve.
The purpose of that is, that I want to model the laying down of the tape by simply moving
the tape segments, which are hidden under the mould, with '*Motion' onto the surface of the mould.
But therefore I have to reference little segments of the tape.
I already wrote a small function for creating segments along a straight line:
def StraightCurve(modelName, start, stop, num_seg, width):
length = stop[0]-start[0]
length_segment = length/num_seg
##
for i in range(step):
# curve
s = mdb.models[modelName].ConstrainedSketch(name='__sweep__',
sheetSize=200.0, transform=[1.0, 0.0, 0.0, 0.0, 0, -1.0, 0.0, 1, 0, 0, 0,0])
g, v, d, c = s.geometry, s.vertices, s.dimensions, s.constraints
s.Line(point1=(start[0]+i*length_segment, start[2]), point2=(start[0]+(i+1)*length_segment, start[2]))
## Tapebreite
s1 = mdb.models[modelName].ConstrainedSketch(name='__profile__',
sheetSize=200.0, transform=(0.0, 0, 1.0, 0.0, 1.0, 0.0, -1.0, 0.0, 1.0, length_segment*i, 0.0, 0.0))
g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints
s1.Line(point1=(-width/2, 20), point2=(width/2,20))
##
p = mdb.models[modelName].Part(name='Segment_%i'%i, dimensionality=THREE_D,
type=DEFORMABLE_BODY)
p.BaseShellSweep(sketch=s1, path=s)
s1.unsetPrimaryObject()
p = mdb.models[modelName].parts['Segment_%i'%i]
del mdb.models[modelName].sketches['__profile__']
del mdb.models[modelName].sketches['__sweep__']
##
If you have any ideas how to create points along a curve in a certain intervall
or you got any other idea how to cerate shell segments along a curve please let me know!
Thanks
Benedikt