mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Covering Face properties corner case
This commit is contained in:
parent
fd44037ef6
commit
36e7958574
1 changed files with 9 additions and 3 deletions
|
|
@ -75,7 +75,7 @@ from OCP.BRepIntCurveSurface import BRepIntCurveSurface_Inter
|
||||||
from OCP.BRepOffsetAPI import BRepOffsetAPI_MakeFilling, BRepOffsetAPI_MakePipeShell
|
from OCP.BRepOffsetAPI import BRepOffsetAPI_MakeFilling, BRepOffsetAPI_MakePipeShell
|
||||||
from OCP.BRepTools import BRepTools, BRepTools_ReShape
|
from OCP.BRepTools import BRepTools, BRepTools_ReShape
|
||||||
from OCP.GProp import GProp_GProps
|
from OCP.GProp import GProp_GProps
|
||||||
from OCP.Geom import Geom_BezierSurface, Geom_Surface
|
from OCP.Geom import Geom_BezierSurface, Geom_Surface, Geom_RectangularTrimmedSurface
|
||||||
from OCP.GeomAPI import GeomAPI_PointsToBSplineSurface, GeomAPI_ProjectPointOnSurf
|
from OCP.GeomAPI import GeomAPI_PointsToBSplineSurface, GeomAPI_ProjectPointOnSurf
|
||||||
from OCP.GeomAbs import GeomAbs_C0
|
from OCP.GeomAbs import GeomAbs_C0
|
||||||
from OCP.Precision import Precision
|
from OCP.Precision import Precision
|
||||||
|
|
@ -554,7 +554,10 @@ class Face(Mixin2D, Shape[TopoDS_Face]):
|
||||||
@property
|
@property
|
||||||
def radius(self) -> None | float:
|
def radius(self) -> None | float:
|
||||||
"""Return the radius of a cylinder or sphere, otherwise None"""
|
"""Return the radius of a cylinder or sphere, otherwise None"""
|
||||||
if self.geom_type in [GeomType.CYLINDER, GeomType.SPHERE]:
|
if (
|
||||||
|
self.geom_type in [GeomType.CYLINDER, GeomType.SPHERE]
|
||||||
|
and type(self.geom_adaptor()) != Geom_RectangularTrimmedSurface
|
||||||
|
):
|
||||||
return self.geom_adaptor().Radius()
|
return self.geom_adaptor().Radius()
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
@ -562,7 +565,10 @@ class Face(Mixin2D, Shape[TopoDS_Face]):
|
||||||
@property
|
@property
|
||||||
def rotational_axis(self) -> None | Axis:
|
def rotational_axis(self) -> None | Axis:
|
||||||
"""Get the rotational axis of a cylinder"""
|
"""Get the rotational axis of a cylinder"""
|
||||||
if self.geom_type == GeomType.CYLINDER:
|
if (
|
||||||
|
self.geom_type == GeomType.CYLINDER
|
||||||
|
and type(self.geom_adaptor()) != Geom_RectangularTrimmedSurface
|
||||||
|
):
|
||||||
return Axis(self.geom_adaptor().Cylinder().Axis())
|
return Axis(self.geom_adaptor().Cylinder().Axis())
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue