You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Threw together a quick example for a variable offset firstwall from a plasma that might be handy to add to the examples scripts as a PR
fromnumpy.lib.function_baseimportangleimportparamakimportrandomimportsubprocess# removes old filessubprocess.call(['rm', 'random_offset_*.svg'])
forcounterinrange(10):
# gets 5 random numbers for the offsetsoffset_1=random.uniform(10, 80)
offset_2=random.uniform(10, 80)
offset_3=random.uniform(10, 80)
offset_4=random.uniform(10, 80)
offset_5=random.uniform(10, 80)
offsets= [offset_1, offset_2, offset_3, offset_4, offset_5, offset_1]
# Simple plasma to offset, other more complex parametric plasma shapes are availbe, see the docs# https://paramak.readthedocs.io/en/main/paramak.parametric_components.html#plasmaboundariesplasma=paramak.Plasma(
rotation_angle=35,
minor_radius=150.0,
major_radius=450.0,
triangularity=0.55,
elongation=2.0,
)
# shape build around plasma with non uniform offsets in this casefirstwall=paramak.BlanketFP(
plasma=plasma,
rotation_angle=35,
thickness=1,
start_angle=0,
stop_angle=360,
offset_from_plasma=offsets# uses a list in this case but accepts a single number, list or function
)
both_shapes=paramak.Reactor([plasma, firstwall])
filename='random_offset_'+str(counter).zfill(3)+'.svg'# saves 3d geomery as svg image, could also be saved as html, stl, or stpboth_shapes.export_svg(
filename=filename,
projectionDir=(5,-5,0),
showHidden=True,
)
# converts svg images to igfsubprocess.check_call(
["convert", "-delay", "40", "random_offset_*.svg", "random_offsets.gif"])
The text was updated successfully, but these errors were encountered:
It seems the thickness of the blanket is not constant. Is it normal ?
I think it looks like the thickness is not constant because of the viewing plane of the svg image. Exporting stp files and viewing on correct plane shows constant thickness
Threw together a quick example for a variable offset firstwall from a plasma that might be handy to add to the examples scripts as a PR
The text was updated successfully, but these errors were encountered: