BRep3D
Canonical path: NemAll_Python_Geometry.BRep3D
Representation class for 3D boundary representation.
AreFacesNaturallyTrimmed
Find if all faces are naturally trimmed by their surfaces
throw Exception in case of invalid object.
Returns:
-
bool
–bool (true = yes)
CreateCone
staticmethod
CreateCuboid
staticmethod
CreateCuboid(
placement: AxisPlacement3D, length: float, width: float, height: float
) -> BRep3D
Create BRep3D as cuboid
Parameters:
-
placement
(AxisPlacement3D
) –cuboid origin
-
length
(float
) –length in its x axis
-
width
(float
) –width in its y axis
-
height
(float
) –height in its z axis
Returns:
-
BRep3D
–created geometry
CreateCylinder
staticmethod
CreateCylinder(
placement: AxisPlacement3D,
radius: float,
height: float,
closedTop: bool = True,
closedBottom: bool = True,
) -> BRep3D
Create Brep as cylinder
Parameters:
-
placement
(AxisPlacement3D
) –axis placement
-
radius
(float
) –cylinder radius
-
height
(float
) –cylinder height
-
closedTop
(bool
, default:True
) –whether to close top of cylinder
-
closedBottom
(bool
, default:True
) –whether to close bottom of cylinder
Returns:
-
BRep3D
–created cone
CreateSphere
staticmethod
CreateSphere(placement: AxisPlacement3D, radius: float) -> BRep3D
Create BRep3D as sphere
Parameters:
-
placement
(AxisPlacement3D
) –sphere origin
-
radius
(float
) –sphere radius
Returns:
-
BRep3D
–created geometry
CreateWireBody
staticmethod
DeleteFace
DeleteFace(faceIndex: int) -> eGeometryErrorCode
Delete face from brep
Parameters:
-
faceIndex
(int
) –index of face we want to delete
Returns:
-
eGeometryErrorCode
–error code
DeleteFaces
DeleteFaces(faceIndices: VecULongList) -> eGeometryErrorCode
Delete faces from brep
Parameters:
-
faceIndices
(VecULongList
) –indices of faces to delete
Returns:
-
eGeometryErrorCode
–error code
GetAllEdgesFlags
GetAllEdgesFlags() -> tuple[eGeometryErrorCode, list[int]]
Get flags of the all edges.
Returns:
-
tuple[eGeometryErrorCode, list[int]]
–tuple(Error code, flags values)
GetAllFacesFlags
GetAllFacesFlags() -> tuple[eGeometryErrorCode, list[int]]
Get flags of the all faces.
Returns:
-
tuple[eGeometryErrorCode, list[int]]
–tuple(Error code, flags values)
GetEdgeCurves
GetEdgeCurves() -> tuple[eGeometryErrorCode, list[Any]]
get all edge curves as BSpline3D
Returns:
-
tuple[eGeometryErrorCode, list[Any]]
–tuple(error code, result edge curves handle vector)
GetEdgeFaceIndices
GetEdgeFaceIndices(edge: int) -> tuple[eGeometryErrorCode, list[int]]
Get faces containing this edge (if any)
Parameters:
-
edge
(int
) –desired edge index
Returns:
-
tuple[eGeometryErrorCode, list[int]]
–tuple(error code, face indices)
GetEdgeGeometry
Get (trimmed) edge geometry as BSpline3D
Parameters:
-
edge
(int
) –edge index
Returns:
-
Any
–handle to geometry curve
GetEdgeParametricCurves
GetEdgeParametricCurves() -> tuple[eGeometryErrorCode, list[Any]]
get parametric curves of all edges
Returns:
-
tuple[eGeometryErrorCode, list[Any]]
–tuple(error code, result edge curves handle vector)
GetEdgeParametricGeometry
Get (trimmed) edge geometry as parametric curves
Parameters:
-
edge
(int
) –edge index
Returns:
-
Any
–handle to geometry curve
GetEdgeVertexIndices
GetEdgeVertexIndices(edge: int) -> tuple
GetEdgeVertices
GetEdgeVertices(edge: int) -> tuple[eGeometryErrorCode, Point3D, Point3D]
get edge vertices
Parameters:
-
edge
(int
) –edge index
Returns:
-
tuple[eGeometryErrorCode, Point3D, Point3D]
–tuple(error code, start vertex, end vertex)
GetExactTypeIsoCurves
GetExactTypeIsoCurves(
ucount: int, vcount: int, planarfaces: bool = False
) -> tuple[eGeometryErrorCode, list[Any]]
Get iso curves from all faces
Parameters:
-
ucount
(int
) –number of u-curves
-
vcount
(int
) –number of v-curves
-
planarfaces
(bool
, default:False
) –include planar faces
Returns:
-
tuple[eGeometryErrorCode, list[Any]]
–tuple(error code, result iso curves handle vector)
GetFaceBoundaryCurves
GetFaceBoundaryCurves(face: int) -> tuple[eGeometryErrorCode, list[Any]]
Get face boundary curves, curves are trimmed
Parameters:
-
face
(int
) –face index
Returns:
-
tuple[eGeometryErrorCode, list[Any]]
–tuple(error code, result geometries)
GetFaceEdgeNaturalTrimming
GetFaceEdgeNaturalTrimming(
face: int, oedge: OrientedEdge
) -> tuple[eGeometryErrorCode, eSurfaceTrimParam]
get edge trimming on this face
Parameters:
-
face
(int
) –face index
-
oedge
(OrientedEdge
) –oriented edge
Returns:
-
tuple[eGeometryErrorCode, eSurfaceTrimParam]
–tuple(error code, result trimming)
GetFaceEdgeOrientation
GetFaceEdgeOrientation(face: int, edge: int) -> tuple[eGeometryErrorCode, bool]
Get orientation of the edge in the given face
Parameters:
-
face
(int
) –face index
-
edge
(int
) –edge index
Returns:
-
tuple[eGeometryErrorCode, bool]
–tuple(error code, result orientation (same = true or opposite = false))
GetFaceEdges
GetFaceEdges(faceIndex: int) -> tuple[eGeometryErrorCode, list[OrientedEdge]]
Get face edges together with their orientations
Parameters:
-
faceIndex
(int
) –face index
Returns:
-
tuple[eGeometryErrorCode, list[OrientedEdge]]
–tuple(error code, result edges)
GetFaceFlags
Get flags of the face.
Parameters:
-
face
(int
) –face index
Returns:
-
int
–flags value
GetFaceGeometry
Get surface geometry of the face
throw Exception in case of invalid input.
Parameters:
-
face
(int
) –face index
Returns:
-
Any
–surface geometry handle
GetFaceGeometryOrientation
Get surface geometry orientation of the face
Parameters:
-
face
(int
) –face index
Returns:
-
bool
–surface geometry orientation
GetFaceLoops
GetFaceLoops(face: int) -> tuple[eGeometryErrorCode, list[int]]
Get loops from given face
Parameters:
-
face
(int
) –face to find loops
Returns:
-
tuple[eGeometryErrorCode, list[int]]
–tuple(error code, face loops indices)
GetFaceLoopsCount
Get count of loops of face given by index
Parameters:
-
face
(int
) –index of face
Returns:
-
int
–count of loops
GetFaceUVBox
GetFaceUVBox(face: int) -> tuple[eGeometryErrorCode, MinMax2D]
Get uv box of the face
Parameters:
-
face
(int
) –selected face
Returns:
-
tuple[eGeometryErrorCode, MinMax2D]
–tuple(error code, uv box of face)
GetFaceVerticesIndices
GetFaceVerticesIndices(faceIndex: int) -> tuple[eGeometryErrorCode, list[int]]
Get indices of vertices for given face index
Parameters:
-
faceIndex
(int
) –index of face
Returns:
-
tuple[eGeometryErrorCode, list[int]]
–tuple(error code, indices of vertices)
GetFinData
GetFinData(fin: int) -> tuple[eGeometryErrorCode, int, bool]
Get index of edge to which fin belongs and its sense
Parameters:
-
fin
(int
) –fin to find infos
Returns:
-
tuple[eGeometryErrorCode, int, bool]
–tuple(error code, index of edge to which fin belongs, fin sense)
GetIsoCurves
GetIsoCurves(
ucount: int, vcount: int, planarfaces: bool = False
) -> tuple[eGeometryErrorCode, list[Any]]
Get iso curves from all faces
Parameters:
-
ucount
(int
) –number of u-curves
-
vcount
(int
) –number of v-curves
-
planarfaces
(bool
, default:False
) –include planar faces
Returns:
-
tuple[eGeometryErrorCode, list[Any]]
–tuple(error code, result iso curves handle vector)
GetLoopFins
GetLoopFins(loop: int) -> tuple[eGeometryErrorCode, list[int]]
Get fins from given loop
Parameters:
-
loop
(int
) –loop to find fins
Returns:
-
tuple[eGeometryErrorCode, list[int]]
–tuple(error code, loop fins indices)
GetParts
GetParts() -> tuple[eGeometryErrorCode, list[BRep3D]]
Get separated parts (continuos shells)
Returns:
-
tuple[eGeometryErrorCode, list[BRep3D]]
–tuple(error code, separated bodies)
GetPartsCount
Get number of parts in this body
Returns:
-
int
–number of parts
GetPlanarFaces
GetRefPoint
GetRefPoint() -> Point3D
GetSilhouetteCurves
GetSilhouetteCurves(
viewMatrix: Matrix3D, bPerspective: bool
) -> tuple[eGeometryErrorCode, list[Any]]
Get silhouette curves of Brep
Parameters:
-
viewMatrix
(Matrix3D
) –View matrix
-
bPerspective
(bool
) –Flag if it is central projection or not (true / false)
Returns:
-
tuple[eGeometryErrorCode, list[Any]]
–tuple(error code, silhouette curves)
GetSilhouetteVertices
GetSilhouetteVertices(
viewMatrix: Matrix3D, bPerspective: bool
) -> tuple[eGeometryErrorCode, list[Point3D]]
Get vertices (end points) of silhouette curves
Parameters:
-
viewMatrix
(Matrix3D
) –view matrix
-
bPerspective
(bool
) –Flag if view is central perspective (true / false)
Returns:
-
tuple[eGeometryErrorCode, list[Point3D]]
–tuple(error code, output vector of found points)
GetVertex
GetVertex(vertexIndex: int) -> tuple[eGeometryErrorCode, Point3D]
Get vertex geometry
Parameters:
-
vertexIndex
(int
) –vertex index
Returns:
-
tuple[eGeometryErrorCode, Point3D]
–tuple(error code, vertex point)
GetVertexEdges
GetVertexEdges(vertex: int) -> tuple[eGeometryErrorCode, list[int]]
Get the edges containing given vertex
Parameters:
-
vertex
(int
) –Index of vertex
Returns:
-
tuple[eGeometryErrorCode, list[int]]
–tuple(Error code, Indices of edges that contains vertex)
GetVertexFaceIndices
GetVertexFaceIndices(vertexIndex: int) -> tuple[eGeometryErrorCode, list[int]]
Get indices of faces for given vertex index
Parameters:
-
vertexIndex
(int
) –index of vertex
Returns:
-
tuple[eGeometryErrorCode, list[int]]
–tuple(error code, indices of faces)
GetVertices
GetVertices() -> tuple[eGeometryErrorCode, list[Point3D]]
Get all vertices from brep
Returns:
-
tuple[eGeometryErrorCode, list[Point3D]]
–tuple(error code, vertices of brep)
GetVirtualVertices
GetVirtualVertices() -> tuple[eGeometryErrorCode, list[Point3D], list[int]]
Get vertices from edges without vertex (get start points of edge curves)
Returns:
-
tuple[eGeometryErrorCode, list[Point3D], list[int]]
–tuple(error code, points (start points of curves), indices of edges without real vertex)
GetVirtualVerticesCount
Get count of vertices (count of edges without vertex)
Returns:
-
int
–count of vertices (edges without vertex)
HasPlanarFaces
Check if this brep contains planar faces
Returns:
-
bool
–bool true = yes
IsClosed
Check whether the B-rep is closed (closed shells)
Returns:
-
bool
–bool true = yes
IsCone
IsCone() -> tuple[bool, AxisPlacement3D, float, float, float]
Check if the b-rep is a cone
Returns:
-
tuple[bool, AxisPlacement3D, float, float, float]
–tuple(bool true = yes, result axis placement (cone bottom center, axis orientation), cone bottom radius, cone top radius, cone height)
IsFaceNaturallyTrimmed
Find if the face is naturally trimmed by its surface
throw Exception in case of invalid input.
Parameters:
-
face
(int
) –face index
Returns:
-
bool
–bool (true = yes)
IsPolyhedron
Check if the b-rep is a polyhedron
Returns:
-
bool
–bool true = yes
IsSphere
IsSphere() -> tuple[bool, AxisPlacement3D, float]
Check if the b-rep is a sphere
Returns:
-
tuple[bool, AxisPlacement3D, float]
–tuple(bool true = yes, result axis placement (sphere center, axis orientation), sphere radius)
IsWire
Check if BRep is wire body. If has only edges.
Returns:
-
bool
–true if BRep is wire.
PickEdge
PickEdge(
rayPoint: Point3D, rayVector: Vector3D, searchRadius: float
) -> tuple[bool, int, float, Point3D]
PickEdges
PickEdges(
rayPoint: Point3D, rayVector: Vector3D, searchRadius: float
) -> tuple[bool, list[int], list[float], list[Point3D]]
PickFace
PickVertex
PickVertex(
rayPoint: Point3D, rayVector: Vector3D, searchRadius: float
) -> tuple[bool, int, float, Point3D]
ReadFromStream
overloaded
ReadFromStream(
sstream_str: str, transformationMatrix: Matrix3D
) -> eGeometryErrorCode
Read BRep3D from string
Parameters:
-
sstream_str
(str
) –input string
-
transformationMatrix
(Matrix3D
) –Matrix to use for BRep transformation
Returns:
-
eGeometryErrorCode
–error code
ReadFromStream(
sstream_str: str,
scale: float,
translation: Vector3D,
spaceminmax: MinMax3D,
visibleminmax: MinMax3D,
) -> eGeometryErrorCode
Read BRep3D from the string
Parameters:
-
sstream_str
(str
) –string to read brep data from
-
scale
(float
) –transformation scale
-
translation
(Vector3D
) –translation vector
-
spaceminmax
(MinMax3D
) –space minmax (including control points
-
visibleminmax
(MinMax3D
) –visible minmax of the body
Returns:
-
eGeometryErrorCode
–error code
Reverse
Reverse() -> eGeometryErrorCode
SetAllEdgesFlags
Set flags to the all edges.
Parameters:
-
flags
(int
) –flags value
SetAllFacesFlags
Set flags to the all faces.
Parameters:
-
flags
(int
) –flags value
SetFaceFlags
Set flags to the face.
Parameters:
-
face
(int
) –face index
-
flags
(int
) –flags value
SetRefPoint
SetRefPoint(refPoint: Point3D)
WriteToStream
WriteToStream() -> tuple[eGeometryErrorCode, str, Matrix3D]
Write BRep3D to the text
Returns:
-
tuple[eGeometryErrorCode, str, Matrix3D]
–tuple(error code, output string, Matrix used to transform BRep)
WriteToStreamSplitTransform
WriteToStreamSplitTransform() -> (
tuple[eGeometryErrorCode, str, float, Vector3D, MinMax3D, MinMax3D]
)
Write BRep3D to the text, get transform parameters and minmax
Returns:
-
tuple[eGeometryErrorCode, str, float, Vector3D, MinMax3D, MinMax3D]
–tuple(error code, output string, transform scale, translation vector, space minmax (including control points), visible minmax of the body)
__eq__
__eq__(brep: BRep3D) -> object
Comparison of breps without tolerance.
Be careful, this method work without tolerance!
Parameters:
-
brep
(BRep3D
) –Compared brep.
Returns:
-
object
–True when breps are equal, otherwise false.