Preliminary implementation of the prism feature

This commit is contained in:
adam-urbanczyk
2019-02-27 21:46:38 +01:00
parent bf6e34d6de
commit 11ee24ee4a

View File

@ -111,6 +111,8 @@ from OCC.Core.Addons import (text_to_brep,
Font_FA_Italic, Font_FA_Italic,
Font_FA_Bold) Font_FA_Bold)
from OCC.Core.BRepFeat import BRepFeat_MakePrism
from math import pi, sqrt from math import pi, sqrt
TOLERANCE = 1e-6 TOLERANCE = 1e-6
@ -1437,6 +1439,25 @@ class Solid(Shape, Mixin3D):
return cls(builder.Shape()) return cls(builder.Shape())
def prism(self, basis, profile, depth=None, thruAll=True, additive=True):
"""
Make a prismatic feature (additive or subtractive)
"""
face = Face.makeFromWires(profile)
feat = BRepFeat_MakePrism(self.wrapped,
basis.wrapped,
face.wrapped,
basis.normalAt().wrapped,
additive,
False)
if thruAll:
feat.PerformThruAll()
else:
feat.Perform(depth)
return self.__class__(feat.Shape())
class Compound(Shape, Mixin3D): class Compound(Shape, Mixin3D):
""" """