pyansys的geometry建模可以接入pyAPDL进行静力学分析吗?给出完整代码,原建模代码为:from pint import Quantity
from ansys.geometry.core import launch_modeler
from ansys.geometry.core.math import Plane, Point3D, Point2D
from ansys.geometry.core.misc import UNITS
from ansys.geometry.core.sketch import Sketch
sketch = Sketch()
(sketch.segment(Point2D([0,0], unit=UNITS.mm), Point2D([70, 0], unit=UNITS.mm))
.segment_to_point(Point2D([70,-150], unit=UNITS.mm))
.segment_to_point(Point2D([670,-150], unit=UNITS.mm))
.segment_to_point(Point2D([670,-624], unit=UNITS.mm))
.segment_to_point(Point2D([70,-624], unit=UNITS.mm))
.segment_to_point(Point2D([70,-774], unit=UNITS.mm))
.segment_to_point(Point2D([0,-774], unit=UNITS.mm))
.segment_to_point(Point2D([0,-624], unit=UNITS.mm))
.segment_to_point(Point2D([-600,-624], unit=UNITS.mm))
.segment_to_point(Point2D([-600,-150], unit=UNITS.mm))
.segment_to_point(Point2D([0, -150], unit=UNITS.mm))
.segment_to_point(Point2D([0, 0], unit=UNITS.mm))
.box(Point2D([35,-105], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(90, UNITS.mm))
.box(Point2D([35, -220], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([35, -387], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(194, UNITS.mm))
.box(Point2D([35, -554], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([35, -669], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(90, UNITS.mm))
.box(Point2D([-565, -240], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(60, UNITS.mm))
.box(Point2D([-387.5, -220], unit=UNITS.mm), Quantity(285, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([-112.5, -220], unit=UNITS.mm), Quantity(225, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([182.5, -220], unit=UNITS.mm), Quantity(225, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([457.5, -220], unit=UNITS.mm), Quantity(285, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([635, -240], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(60, UNITS.mm))
.box(Point2D([-565, -387], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(194, UNITS.mm))
.box(Point2D([-387.5, -387], unit=UNITS.mm), Quantity(285, UNITS.mm), Quantity(194, UNITS.mm))
.box(Point2D([-112.5, -387], unit=UNITS.mm), Quantity(225, UNITS.mm), Quantity(194, UNITS.mm))
.box(Point2D([182.5, -387], unit=UNITS.mm), Quantity(225, UNITS.mm), Quantity(194, UNITS.mm))
.box(Point2D([457.5, -387], unit=UNITS.mm), Quantity(285, UNITS.mm), Quantity(194, UNITS.mm))
.box(Point2D([635, -387], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(194, UNITS.mm))
.box(Point2D([-565, -534], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(60, UNITS.mm))
.box(Point2D([-387.5, -554], unit=UNITS.mm), Quantity(285, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([-112.5, -554], unit=UNITS.mm), Quantity(225, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([182.5, -554], unit=UNITS.mm), Quantity(225, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([457.5, -554], unit=UNITS.mm), Quantity(285, UNITS.mm), Quantity(100, UNITS.mm))
.box(Point2D([635, -534], unit=UNITS.mm), Quantity(30, UNITS.mm), Quantity(60, UNITS.mm))
)
modeler = launch_modeler()
design = modeler.create_design("ExtrudedPlateNoHoles")
body = design.extrude_sketch(f"PlateLayer", sketch, Quantity(20, UNITS.mm))
design.plot()
最新发布