Preliminary implementation of the prism feature
This commit is contained in:
@ -111,6 +111,8 @@ from OCC.Core.Addons import (text_to_brep,
|
||||
Font_FA_Italic,
|
||||
Font_FA_Bold)
|
||||
|
||||
from OCC.Core.BRepFeat import BRepFeat_MakePrism
|
||||
|
||||
from math import pi, sqrt
|
||||
|
||||
TOLERANCE = 1e-6
|
||||
@ -1437,6 +1439,25 @@ class Solid(Shape, Mixin3D):
|
||||
|
||||
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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user