Skip to content

Commit

Permalink
Merge pull request #26 from fusion-energy/fixing-VV-cutting
Browse files Browse the repository at this point in the history
added rotate_solid and perform_boolean_operations to the create solid…
  • Loading branch information
shimwell authored Jul 15, 2021
2 parents 97bc808 + 652542c commit 443a636
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions paramak/parametric_components/vacuum_vessel_inner_leg.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def create_solid(self):
solid = big_solid.cut(small_solid).cut(inner_solid)

self.wire = [big_wire, small_wire]
solid = self.rotate_solid(solid)
solid = self.perform_boolean_operations(solid)

self.solid = solid

Expand Down
23 changes: 21 additions & 2 deletions tests/test_parametric_components/test_VacuumVesselInnerLeg.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@

import unittest

import pytest
import paramak


class TestVacuumVessel(unittest.TestCase):

def setUp(self):
self.cutter = paramak.PortCutterRectangular(
width=100,
height=100,
distance=1100,
azimuth_placement_angle=[
0,
90,
180,
270])
self.test_shape = paramak.VacuumVesselInnerLeg(
inner_height=1100,
inner_radius=700,
inner_leg_radius=100,
thickness=0.2
thickness=100,
)
self.test_shape_cut = paramak.VacuumVesselInnerLeg(
inner_height=1100,
inner_radius=700,
inner_leg_radius=100,
thickness=100,
cut=self.cutter
)

def test_creation(self):
"""Creates a shape using the VacuumVessel parametric component and
checks that a cadquery solid is created."""

assert self.test_shape.solid is not None

def test_cut(self):
assert self.test_shape.volume != self.test_shape_cut.volume

0 comments on commit 443a636

Please sign in to comment.