diff --git a/paramak/parametric_components/blanket_poloidal_segment.py b/paramak/parametric_components/blanket_poloidal_segment.py index 37a9fe4fd..45f305cf6 100644 --- a/paramak/parametric_components/blanket_poloidal_segment.py +++ b/paramak/parametric_components/blanket_poloidal_segment.py @@ -129,7 +129,7 @@ def create_segment_cutters(self): cutting_shape = RotateStraightShape( rotation_angle=self.rotation_angle, azimuth_placement_angle=self.azimuth_placement_angle, - union=[]) + boolean_operations={"union": []}) # add points to the shape to avoid void solid cutting_shape.points = [ (self.major_radius, @@ -188,7 +188,7 @@ def create_segment_cutters(self): angle=np.pi / 2)] cutter.points = points_cutter # add cutter to global cutting shape - cutting_shape.union.append(cutter) + cutting_shape.boolean_operations["union"].append(cutter) self.segments_cutters = cutting_shape diff --git a/paramak/parametric_components/inboard_firstwall_fccs.py b/paramak/parametric_components/inboard_firstwall_fccs.py index ffb65760f..1c1eb231a 100644 --- a/paramak/parametric_components/inboard_firstwall_fccs.py +++ b/paramak/parametric_components/inboard_firstwall_fccs.py @@ -152,10 +152,22 @@ def find_points(self): points = firstwall.points[:-1] # remove last point self.points = points - # add to cut attribute - if self.cut is None: - self.cut = self.central_column_shield - elif isinstance(self.cut, Iterable): - self.cut = [*self.cut, self.central_column_shield] + if self.boolean_operations is None: + self.boolean_operations = {"cut": self.central_column_shield} + elif "cut" not in self.boolean_operations: + self.boolean_operations["cut"] = self.central_column_shield + elif isinstance(self.boolean_operations["cut"], Iterable): + self.boolean_operations["cut"] = [ + *self.boolean_operations["cut"], + self.central_column_shield] else: - self.cut = [*[self.cut], self.central_column_shield] + self.boolean_operations["cut"] = [ + *[self.boolean_operations["cut"]], self.central_column_shield] + + # add to cut attribute + # if self.cut is None: + # self.cut = self.central_column_shield + # elif isinstance(self.cut, Iterable): + # self.cut = [*self.cut, self.central_column_shield] + # else: + # self.cut = [*[self.cut], self.central_column_shield] diff --git a/paramak/parametric_reactors/ball_reactor.py b/paramak/parametric_reactors/ball_reactor.py index 6cae0fb92..e418bcea2 100644 --- a/paramak/parametric_reactors/ball_reactor.py +++ b/paramak/parametric_reactors/ball_reactor.py @@ -392,7 +392,7 @@ def _make_blankets_layers(self): material_tag="firstwall_mat", stp_filename="firstwall.stp", stl_filename="firstwall.stl", - cut=[self._center_column_cutter] + boolean_operations={"cut": [self._center_column_cutter]} ) self._blanket = paramak.BlanketFP( @@ -406,7 +406,8 @@ def _make_blankets_layers(self): material_tag="blanket_mat", stp_filename="blanket.stp", stl_filename="blanket.stl", - cut=[self._center_column_cutter]) + boolean_operations={"cut": [self._center_column_cutter]} + ) self._blanket_rear_wall = paramak.BlanketFP( plasma=self._plasma, @@ -420,7 +421,7 @@ def _make_blankets_layers(self): material_tag="blanket_rear_wall_mat", stp_filename="blanket_rear_wall.stp", stl_filename="blanket_rear_wall.stl", - cut=[self._center_column_cutter], + boolean_operations={"cut": [self._center_column_cutter]} ) return [self._firstwall, self._blanket, self._blanket_rear_wall] @@ -454,7 +455,7 @@ def _make_divertor(self): (self._divertor_end_radius, divertor_height_top), (self._divertor_start_radius, divertor_height_top) ], - intersect=self._blanket_fw_rear_wall_envelope, + boolean_operations={"intersect": self._blanket_fw_rear_wall_envelope}, stp_filename="divertor.stp", stl_filename="divertor.stl", name="divertor", @@ -466,7 +467,7 @@ def _make_divertor(self): self._firstwall, self._blanket, self._blanket_rear_wall]: - component.cut.append(self._divertor) + component.boolean_operations["cut"].append(self._divertor) return self._divertor diff --git a/paramak/parametric_reactors/center_column_study_reactor.py b/paramak/parametric_reactors/center_column_study_reactor.py index 44da9f067..5c11d5032 100644 --- a/paramak/parametric_reactors/center_column_study_reactor.py +++ b/paramak/parametric_reactors/center_column_study_reactor.py @@ -268,12 +268,12 @@ def _make_outboard_blanket(self): start_angle=-180, stop_angle=180, rotation_angle=self.rotation_angle, - cut=[self._center_column_cutter] + boolean_operations={"cut": [self._center_column_cutter]} ) return self._blanket def _make_divertor(self): - self._blanket_enveloppe = paramak.BlanketFP( + self._blanket_envelope = paramak.BlanketFP( plasma=self._plasma, thickness=100., offset_from_plasma=[ @@ -285,7 +285,7 @@ def _make_divertor(self): start_angle=-180, stop_angle=180, rotation_angle=self.rotation_angle, - cut=[self._center_column_cutter] + boolean_operations={"cut": [self._center_column_cutter]} ) self._divertor = paramak.CenterColumnShieldCylinder( @@ -298,7 +298,7 @@ def _make_divertor(self): stl_filename="divertor.stl", name="divertor", material_tag="divertor_mat", - intersect=self._blanket_enveloppe, + boolean_operations={"intersect": self._blanket_envelope} ) - self._blanket.cut.append(self._divertor) + self._blanket.boolean_operations["cut"].append(self._divertor) return self._divertor diff --git a/paramak/parametric_reactors/eu_demo_2015_reactor.py b/paramak/parametric_reactors/eu_demo_2015_reactor.py index 39ffad2e3..a3dea13fa 100644 --- a/paramak/parametric_reactors/eu_demo_2015_reactor.py +++ b/paramak/parametric_reactors/eu_demo_2015_reactor.py @@ -83,7 +83,7 @@ def create_tf_coils(self, vac_vessel_inner, vac_vessel) -> list: (375.4508992805756, 755, "straight"), ], distance=200, - cut=[vac_vessel_inner, vac_vessel], + boolean_operations={"cut": [vac_vessel_inner, vac_vessel]}, # azimuth placement angle can't start at # zero nor end at 360 until #757 is solved azimuth_placement_angle=np.linspace( @@ -220,7 +220,7 @@ def create_vessel_components(self) -> list: ], rotation_angle=self.rotation_angle, # avoid overlap between VV and blanket divertor - union=[blanket, divertor] + boolean_operations={"union": [blanket, divertor]} ) vac_vessel = paramak.RotateSplineShape( points=[ @@ -276,7 +276,7 @@ def create_vessel_components(self) -> list: (516.7486775621876, -175.64585325476332), (516.7486775621876, -107.40944903301386), ], - cut=vac_vessel_inner, # hollow shape + boolean_operations={"cut": vac_vessel_inner}, rotation_angle=self.rotation_angle, stp_filename='vacvessel.stp', stl_filename='vacvessel.stl', diff --git a/paramak/parametric_reactors/segmented_blanket_ball_reactor.py b/paramak/parametric_reactors/segmented_blanket_ball_reactor.py index ea79b5ba9..10fdbfb65 100644 --- a/paramak/parametric_reactors/segmented_blanket_ball_reactor.py +++ b/paramak/parametric_reactors/segmented_blanket_ball_reactor.py @@ -76,7 +76,8 @@ def _make_blankets_layers(self): 2 * self.firstwall_radial_thickness, azimuth_placement_angle=azimuth_placement_angles) - self._blanket.cut = [self._center_column_cutter, thick_cutter] + self._blanket.boolean_operations = { + "cut": [self._center_column_cutter, thick_cutter]} if self.blanket_fillet_radius != 0: # tried firstwall start radius here already @@ -90,10 +91,10 @@ def _make_blankets_layers(self): paramak.EdgeLengthSelector(front_edge_length_b)).fillet( self.blanket_fillet_radius) self._firstwall.thickness += self.blanket_radial_thickness - self._firstwall.cut = [ + self._firstwall.boolean_operations = {"cut": [ self._center_column_cutter, thin_cutter, - self._blanket] + self._blanket]} # TODO this segfaults at the moment but works as an opperation on the # reactor after construction in jupyter diff --git a/paramak/parametric_reactors/sparc_paper_2020.py b/paramak/parametric_reactors/sparc_paper_2020.py index 6823e08dd..16982cadf 100644 --- a/paramak/parametric_reactors/sparc_paper_2020.py +++ b/paramak/parametric_reactors/sparc_paper_2020.py @@ -294,7 +294,7 @@ def create_vessel_components(self, vs_coils): ], rotation_angle=self.rotation_angle, stp_filename='inner_vessel.stp', - cut=[vac_vessel, vs_coils, antenna] + boolean_operations={"cut": [vac_vessel, vs_coils, antenna]} ) return [antenna, vac_vessel, inner_vessel] diff --git a/paramak/parametric_reactors/submersion_reactor.py b/paramak/parametric_reactors/submersion_reactor.py index 4496f05fb..f961637a7 100644 --- a/paramak/parametric_reactors/submersion_reactor.py +++ b/paramak/parametric_reactors/submersion_reactor.py @@ -444,7 +444,7 @@ def _make_firstwall(self): stl_filename="outboard_firstwall.stl", name="outboard_firstwall", material_tag="firstwall_mat", - union=self._inboard_firstwall, + boolean_operations={"union": self._inboard_firstwall} ) return self._firstwall @@ -469,7 +469,7 @@ def _make_divertor(self): stl_filename="outboard_firstwall.stl", name="outboard_firstwall", material_tag="firstwall_mat", - union=fw_enveloppe_inboard, + boolean_operations={"union": fw_enveloppe_inboard} ) divertor_height = self._blanket_rear_wall_end_height @@ -488,7 +488,7 @@ def _make_divertor(self): (self._divertor_end_radius, divertor_height_top), (self._divertor_start_radius, divertor_height_top) ], - intersect=fw_enveloppe, + boolean_operations={"intersect": fw_enveloppe}, rotation_angle=self.rotation_angle, stp_filename="divertor.stp", stl_filename="divertor.stl", @@ -496,8 +496,8 @@ def _make_divertor(self): material_tag="divertor_mat" ) - self._firstwall.cut = self._divertor - self._inboard_firstwall.cut = self._divertor + self._firstwall.boolean_operations["cut"] = self._divertor + self._inboard_firstwall.boolean_operations = {"cut": self._divertor} return self._divertor def _make_blanket(self): @@ -506,7 +506,7 @@ def _make_blanket(self): inner_radius=self._inboard_blanket_start_radius, outer_radius=max(self._inboard_firstwall.points)[0], rotation_angle=self.rotation_angle, - cut=self._inboard_firstwall, + boolean_operations={"cut": self._inboard_firstwall} ) # this takes a single solid from a compound of solids by finding the @@ -529,7 +529,7 @@ def _make_blanket(self): stl_filename="blanket.stl", name="blanket", material_tag="blanket_mat", - union=self._inboard_blanket, + boolean_operations={"union": self._inboard_blanket} ) return self._blanket @@ -542,7 +542,7 @@ def _make_supports(self): + self.firstwall_radial_thickness, thickness=self.outboard_blanket_radial_thickness, rotation_angle=self.rotation_angle, - union=self._inboard_blanket, + boolean_operations={"union": self._inboard_blanket} ) support_height = self._blanket_rear_wall_end_height support_height_top = support_height @@ -565,9 +565,9 @@ def _make_supports(self): stl_filename="supports.stl", name="supports", material_tag="supports_mat", - intersect=blanket_enveloppe, + boolean_operations={"intersect": blanket_enveloppe} ) - self._blanket.cut = self._supports + self._blanket.boolean_operations["cut"] = self._supports return self._supports @@ -629,9 +629,10 @@ def _make_rear_blanket_wall(self): stl_filename="outboard_rear_blanket_wall.stl", name="outboard_rear_blanket_wall", material_tag="blanket_rear_wall_mat", - union=[ + boolean_operations={"union": [ self._outboard_rear_blanket_wall_upper, - self._outboard_rear_blanket_wall_lower], + self._outboard_rear_blanket_wall_lower + ]}, ) return self._outboard_rear_blanket_wall diff --git a/paramak/shape.py b/paramak/shape.py index 8458be1b5..e2a3ed597 100644 --- a/paramak/shape.py +++ b/paramak/shape.py @@ -60,15 +60,9 @@ class Shape: description output. Defaults to None. physical_groups (dict, optional): contains information on physical groups (volumes and surfaces). Defaults to None. - cut (paramak.shape or list, optional): If set, the current solid will - be cut with the provided solid or iterable in cut. Defaults to - None. - intersect (paramak.shape or list, optional): If set, the current solid - will be interested with the provided solid or iterable of solids. - Defaults to None. - union (paramak.shape or list, optional): If set, the current solid - will be united with the provided solid or iterable of solids. - Defaults to None. + boolean_operations (dict, optional): dictionary of boolean operations + (cut, union, intersect) and the associated shapes with which the + operations will be performed with. Defaults to None. """ def __init__( @@ -87,9 +81,7 @@ def __init__( surface_reflectivity: Optional[bool] = False, physical_groups=None, # TODO defining Shape types as paramak.Shape results in circular import - cut=None, - intersect=None, - union=None, + boolean_operations: Optional[dict] = None ): self.connection_type = connection_type @@ -99,9 +91,7 @@ def __init__( self.color = color self.name = name - self.cut = cut - self.intersect = intersect - self.union = union + self.boolean_operations = boolean_operations self.azimuth_placement_angle = azimuth_placement_angle self.workplane = workplane @@ -1129,28 +1119,23 @@ def neutronics_description(self) -> dict: return neutronics_description def perform_boolean_operations(self, solid: cq.Workplane, **kwargs): - """Performs boolean cut, intersect and union operations if shapes are - provided""" - # If a cut solid is provided then perform a boolean cut - if self.cut is not None: - solid = cut_solid(solid, self.cut) + if self.boolean_operations is not None: + for operation, shapes in self.boolean_operations.items(): + if shapes is not None: + if operation == 'cut': + solid = cut_solid(solid, shapes) + + if operation == 'union': + solid = union_solid(solid, shapes) + + if operation == 'intersect': + solid = intersect_solid(solid, shapes) - # If a wedge cut is provided then perform a boolean cut - # Performed independantly to avoid use of self.cut - # Prevents repetition of 'outdated' wedge cuts if 'wedge_cut' in kwargs: if kwargs['wedge_cut'] is not None: solid = cut_solid(solid, kwargs['wedge_cut']) - # If an intersect is provided then perform a boolean intersect - if self.intersect is not None: - solid = intersect_solid(solid, self.intersect) - - # If an intersect is provided then perform a boolean intersect - if self.union is not None: - solid = union_solid(solid, self.union) - return solid def make_graveyard( diff --git a/tests/test_parametric_components/test_InboardFirstwallFCCS.py b/tests/test_parametric_components/test_InboardFirstwallFCCS.py index 1e6dd2c18..582b40bf6 100644 --- a/tests/test_parametric_components/test_InboardFirstwallFCCS.py +++ b/tests/test_parametric_components/test_InboardFirstwallFCCS.py @@ -146,7 +146,7 @@ def test_boolean_union(self): thickness=20, rotation_angle=180, azimuth_placement_angle=180, - union=b) + boolean_operations={"union": b}) assert np.isclose(c.volume, 2 * b.volume) def test_azimuth_placement_angle(self): @@ -171,7 +171,7 @@ def test_azimuth_placement_angle(self): thickness=20, rotation_angle=180, azimuth_placement_angle=90, - cut=b) + boolean_operations={"cut": b}) assert np.isclose(c.volume, 0.5 * b.volume) def test_cut_attribute(self): diff --git a/tests/test_parametric_components/test_PoloidallySegmentedBlanketFP.py b/tests/test_parametric_components/test_PoloidallySegmentedBlanketFP.py index db18b4321..28fd98a1d 100644 --- a/tests/test_parametric_components/test_PoloidallySegmentedBlanketFP.py +++ b/tests/test_parametric_components/test_PoloidallySegmentedBlanketFP.py @@ -61,7 +61,7 @@ def test_modifying_nb_segments_limits(self): blanket2 = paramak.BlanketFPPoloidalSegments( thickness=20, start_angle=0, stop_angle=180, rotation_angle=180, - cut=blanket1) + boolean_operations={"cut": blanket1}) blanket1.nb_segments_limits = (4, 8) blanket2.nb_segments_limits = (3, 8) @@ -76,7 +76,7 @@ def test_segments_angles_is_modified_num_segments(self): blanket2 = paramak.BlanketFPPoloidalSegments( thickness=20, start_angle=0, stop_angle=180, rotation_angle=180, - cut=blanket1) + boolean_operations={"cut": blanket1}) blanket1.num_segments = 8 blanket2.num_segments = 5 @@ -97,7 +97,7 @@ def test_segment_angles_affects_solid(self): blanket2 = paramak.BlanketFPPoloidalSegments( thickness=20, start_angle=0, stop_angle=180, rotation_angle=180, - cut=blanket1) + boolean_operations={"cut": blanket1}) blanket2.segments_angles = [0, 25, 50, 90, 130, 150, 180] assert blanket2.volume != 0 diff --git a/tests/test_parametric_components/test_PortCutterRectangular.py b/tests/test_parametric_components/test_PortCutterRectangular.py index 7d5c4d374..bf03bbb37 100644 --- a/tests/test_parametric_components/test_PortCutterRectangular.py +++ b/tests/test_parametric_components/test_PortCutterRectangular.py @@ -64,7 +64,7 @@ def test_workplane(self): points=[(0, 0), (0, 50), (500, 50), (500, 0)], workplane="YZ", ) - self.test_shape.cut = cutting_shape + self.test_shape.boolean_operations = {"cut": cutting_shape} assert self.test_shape.volume == pytest.approx(20 * 40 * 300 * 0.5) diff --git a/tests/test_parametric_components/test_PortCutterRotated.py b/tests/test_parametric_components/test_PortCutterRotated.py index 1040289d9..b7c52a0c5 100644 --- a/tests/test_parametric_components/test_PortCutterRotated.py +++ b/tests/test_parametric_components/test_PortCutterRotated.py @@ -37,14 +37,14 @@ def test_shape_construction_and_volume(self): height=500, inner_radius=200, outer_radius=300, - cut=small_ports + boolean_operations={"cut": small_ports} ) vessel_with_large_ports = paramak.CenterColumnShieldCylinder( height=500, inner_radius=200, outer_radius=300, - cut=large_ports + boolean_operations={"cut": large_ports} ) assert large_ports.volume > small_ports.volume diff --git a/tests/test_parametric_components/test_VacuumVessel.py b/tests/test_parametric_components/test_VacuumVessel.py index 3499c4d47..12df1e70a 100644 --- a/tests/test_parametric_components/test_VacuumVessel.py +++ b/tests/test_parametric_components/test_VacuumVessel.py @@ -44,6 +44,7 @@ def test_ports(self): pre_cut_volume = self.test_shape.volume - self.test_shape.cut = [cutter1, cutter2, cutter3, cutter4, cutter5] + self.test_shape.boolean_operations = { + "cut": [cutter1, cutter2, cutter3, cutter4, cutter5]} assert self.test_shape.solid is not None assert self.test_shape.volume < pre_cut_volume diff --git a/tests/test_parametric_shapes/test_ExtrudeCircleShape.py b/tests/test_parametric_shapes/test_ExtrudeCircleShape.py index 0860b3d83..dffc1c089 100644 --- a/tests/test_parametric_shapes/test_ExtrudeCircleShape.py +++ b/tests/test_parametric_shapes/test_ExtrudeCircleShape.py @@ -55,7 +55,7 @@ def test_cut_volume(self): shape_with_cut = ExtrudeCircleShape( points=[(30, 0)], radius=20, distance=40, - cut=self.test_shape + boolean_operations={"cut": self.test_shape} ) assert shape_with_cut.volume == pytest.approx( @@ -70,9 +70,10 @@ def test_intersect_volume(self): points=[(30, 0)], radius=5, distance=50) intersected_shape = ExtrudeCircleShape( - points=[(30, 0)], radius=10, distance=50, - intersect=[self.test_shape, intersect_shape] - ) + points=[ + (30, 0)], radius=10, distance=50, boolean_operations={ + "intersect": [ + self.test_shape, intersect_shape]}) assert intersected_shape.volume == pytest.approx(math.pi * 5**2 * 30) diff --git a/tests/test_parametric_shapes/test_ExtrudeMixedShape.py b/tests/test_parametric_shapes/test_ExtrudeMixedShape.py index 5e0ce04cd..94071d744 100644 --- a/tests/test_parametric_shapes/test_ExtrudeMixedShape.py +++ b/tests/test_parametric_shapes/test_ExtrudeMixedShape.py @@ -103,7 +103,7 @@ def test_cut_volume(self): (12, 12, "spline"), (12, 3, "spline"), ], - cut=inner_shape, + boolean_operations={"cut": inner_shape}, distance=30, ) diff --git a/tests/test_parametric_shapes/test_ExtrudeSplineShape.py b/tests/test_parametric_shapes/test_ExtrudeSplineShape.py index c04685620..9ef04daf0 100644 --- a/tests/test_parametric_shapes/test_ExtrudeSplineShape.py +++ b/tests/test_parametric_shapes/test_ExtrudeSplineShape.py @@ -59,7 +59,8 @@ def test_cut_volume(self): ) outer_shape_with_cut = ExtrudeSplineShape( - points=[(3, 3), (3, 12), (12, 12), (12, 3)], cut=inner_shape, + points=[(3, 3), (3, 12), (12, 12), (12, 3)], + boolean_operations={"cut": inner_shape}, distance=30, ) diff --git a/tests/test_parametric_shapes/test_ExtrudeStraightShape.py b/tests/test_parametric_shapes/test_ExtrudeStraightShape.py index 921ae3632..691d85d57 100644 --- a/tests/test_parametric_shapes/test_ExtrudeStraightShape.py +++ b/tests/test_parametric_shapes/test_ExtrudeStraightShape.py @@ -53,7 +53,7 @@ def test_cut_volume(self): shape_with_cut = ExtrudeStraightShape( points=[(0, 0), (0, 40), (40, 40), (40, 0)], distance=40, - cut=self.test_shape + boolean_operations={"cut": self.test_shape} ) assert shape_with_cut.volume == pytest.approx( @@ -66,7 +66,7 @@ def test_union_volume(self): unioned_shape = ExtrudeStraightShape( points=[(0, 10), (0, 30), (20, 30), (20, 10)], distance=30, - union=self.test_shape + boolean_operations={"union": self.test_shape} ) assert unioned_shape.volume == pytest.approx(30 * 20 * 30) @@ -76,7 +76,7 @@ def test_intersect_volume(self): intersected_shape = ExtrudeStraightShape( points=[(0, 10), (0, 30), (20, 30), (20, 10)], distance=30, - intersect=self.test_shape + boolean_operations={"intersect": self.test_shape} ) assert intersected_shape.volume == pytest.approx(10 * 20 * 30) diff --git a/tests/test_parametric_shapes/test_RotateCircleShape.py b/tests/test_parametric_shapes/test_RotateCircleShape.py index 2136fa470..98f44387f 100644 --- a/tests/test_parametric_shapes/test_RotateCircleShape.py +++ b/tests/test_parametric_shapes/test_RotateCircleShape.py @@ -78,7 +78,7 @@ def test_cut_volume(self): points=[(60, 0)], radius=15 ) outer_shape_volume = outer_shape.volume - outer_shape.cut = self.test_shape + outer_shape.boolean_operations = {"cut": self.test_shape} assert outer_shape.volume == pytest.approx( outer_shape_volume - self.test_shape.volume ) diff --git a/tests/test_parametric_shapes/test_RotateMixedShape.py b/tests/test_parametric_shapes/test_RotateMixedShape.py index 9a6d5718b..6b4ed4b8b 100644 --- a/tests/test_parametric_shapes/test_RotateMixedShape.py +++ b/tests/test_parametric_shapes/test_RotateMixedShape.py @@ -121,7 +121,7 @@ def test_union_volume_addition(self): (500, 200, "straight"), (500, 100, "straight"), ], - union=inner_box, + boolean_operations={"union": inner_box} ) assert inner_box.volume + outer_box.volume == pytest.approx( @@ -173,7 +173,7 @@ def test_cut_volume(self): ] ) outer_shape_volume = outer_shape.volume - outer_shape.cut = self.test_shape + outer_shape.boolean_operations = {"cut": self.test_shape} assert outer_shape.volume == pytest.approx( outer_shape_volume - self.test_shape.volume ) diff --git a/tests/test_parametric_shapes/test_RotateSplineShape.py b/tests/test_parametric_shapes/test_RotateSplineShape.py index fe69b1aff..5cd5e6024 100644 --- a/tests/test_parametric_shapes/test_RotateSplineShape.py +++ b/tests/test_parametric_shapes/test_RotateSplineShape.py @@ -50,7 +50,7 @@ def test_cut_volume(self): outer_shape_with_cut = RotateSplineShape( points=[(3, 3), (3, 12), (12, 12), (12, 3)], - cut=inner_shape, + boolean_operations={"cut": inner_shape}, rotation_angle=180, ) diff --git a/tests/test_parametric_shapes/test_RotateStraightShape.py b/tests/test_parametric_shapes/test_RotateStraightShape.py index 5dc97c818..6944cdad7 100644 --- a/tests/test_parametric_shapes/test_RotateStraightShape.py +++ b/tests/test_parametric_shapes/test_RotateStraightShape.py @@ -63,7 +63,7 @@ def test_union_volume_addition(self): outer_box_and_inner_box = RotateStraightShape( points=[(200, 100), (200, 200), (500, 200), (500, 100)], - union=inner_box, + boolean_operations={"union": inner_box} ) assert inner_box.volume + outer_box.volume == pytest.approx( @@ -215,7 +215,7 @@ def test_cut_volume(self): shape_with_cut = RotateStraightShape( points=[(0, -5), (0, 25), (25, 25), (25, -5)], - cut=self.test_shape + boolean_operations={"cut": self.test_shape} ) assert shape_with_cut.volume == pytest.approx( @@ -240,7 +240,7 @@ def test_multiple_cut_volume(self): main_shape_with_cuts = RotateStraightShape( points=[(0, 0), (0, 200), (200, 200), (200, 0)], - cut=[shape_to_cut_1, shape_to_cut_2] + boolean_operations={"cut": [shape_to_cut_1, shape_to_cut_2]} ) assert main_shape_with_cuts.volume == pytest.approx(