Skip to content
4 changes: 2 additions & 2 deletions examples/3Doperations/rasterEllipsoid/rasterEllipsoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
elem = Ellipsoid(radii=(0.15, 0.31, 0.4))
elli = elem.generate_cad()

raster = raster_phase(phase=Phase(shape=elli), rve=rve, grid=[5, 5, 5])
raster = raster_phase(phase=Phase.from_cad(elli), rve=rve, grid=[5, 5, 5])

compound = make_compound_from_solids(
[solid for phase in raster for solid in phase.solids]
[solid.wrapped for phase in raster for solid in phase.cad.solids()]
)
step_file = str(Path(__file__).parent / "compound.step")
compound.export_step(step_file)
Expand Down
2 changes: 1 addition & 1 deletion examples/3Doperations/voronoi/voronoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
step_file = str(Path(__file__).parent / "compound.step")
compound.export_step(step_file)

phases = [Phase(shape=shape) for shape in shapes]
phases = [Phase.from_cad(shape) for shape in shapes]

vtk_file = str(Path(__file__).parent / "Voronoi.vtk")
mesh(
Expand Down
4 changes: 2 additions & 2 deletions examples/3Doperations/voronoiGyroid/voronoiGyroid.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
phases = []
for polyhedron in polyhedra:
shape = polyhedron.generate_cad()
phases.append(Phase(shape=shape.intersect(gyroid)))
phases.append(Phase.from_cad(shape.intersect(gyroid)))

compound = make_compound([phase.shape for phase in phases])
compound = make_compound([phase.cad for phase in phases])
step_file = str(Path(__file__).parent / "compound.step")
compound.export_step(step_file)

Expand Down
6 changes: 3 additions & 3 deletions examples/Lattices/honeycomb/honeycomb.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
)
shapeList.append(poly.generate_cad())

boxPhase = Phase(shape=box.generate_cad())
boxPhase = Phase.from_cad(box.generate_cad())

honeycomb = cut_phase_by_shape_list(phase_to_cut=boxPhase, shapes=shapeList)

step_file = str(Path(__file__).parent / "honeycomb.step")
stl_file = str(Path(__file__).parent / "honeycomb.stl")
honeycomb.shape.export_step(step_file)
honeycomb.shape.export_stl(stl_file)
honeycomb.cad.export_step(step_file)
honeycomb.cad.export_stl(stl_file)
vtk_file = str(Path(__file__).parent / "honeycomb.vtk")
mesh(
mesh_file=step_file,
Expand Down
4 changes: 2 additions & 2 deletions examples/Lattices/octetTruss/octetTruss.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@
height=height[i],
radius=radius[i],
)
list_phases.append(Phase(shape=elem.generate_cad()))
list_phases.append(Phase.from_cad(elem.generate_cad()))

for phase_elem in list_phases:
periodicPhase = periodic_split_and_translate(phase=phase_elem, rve=rve)
listPeriodicPhases.append(periodicPhase)

phases_cut = cut_phases(phases=listPeriodicPhases, reverse_order=False)
compound = make_compound([phase.shape for phase in phases_cut])
compound = make_compound([phase.cad for phase in phases_cut])

step_file = str(Path(__file__).parent / "octettruss.step")
stl_file = str(Path(__file__).parent / "octettruss.stl")
Expand Down
4 changes: 2 additions & 2 deletions examples/Mesh/gyroid/gyroid_step_remesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

# 2. Wrap the geometry into a microgen Phase object.
phases = []
phases.append(Phase(shape=geometry.generate_cad()))
phases.append(Phase.from_cad(geometry.generate_cad()))
rve = Rve(dim=1)

# 3. Export the geometry as a STEP file.
step_file = str(Path(__file__).parent / "gyroid.step")
phases[0].shape.export_step(step_file)
phases[0].cad.export_step(step_file)

# 4. Import the STEP file and create a mesh with periodic constraints and export as VTK.

Expand Down
Loading
Loading