Skip to content

BRep3D

Canonical path: NemAll_Python_Geometry.BRep3D

Representation class for 3D boundary representation.

AllEdgesFlags property writable

AllEdgesFlags: eGeometryErrorCode

Get flags of the all edges.

AllFacesFlags property writable

AllFacesFlags: eGeometryErrorCode

Get flags of the all faces.

RefPoint property writable

RefPoint: Point3D

Get the reference point

AreFacesNaturallyTrimmed

AreFacesNaturallyTrimmed() -> bool

Find if all faces are naturally trimmed by their surfaces

throw Exception in case of invalid object.

Returns:

  • bool

    bool (true = yes)

CreateCone staticmethod

CreateCone(cone: Cone3D, closed: bool = True) -> BRep3D

Create BRep3D as cone

Parameters:

  • cone (Cone3D) –

    cone data

  • closed (bool, default: True ) –

    whether to create solid or sheet body

Returns:

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:

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:

CreateSphere staticmethod

CreateSphere(placement: AxisPlacement3D, radius: float) -> BRep3D

Create BRep3D as sphere

Parameters:

  • placement (AxisPlacement3D) –

    sphere origin

  • radius (float) –

    sphere radius

Returns:

CreateWireBody staticmethod

CreateWireBody(
    icurve: (
        Arc3D | BSpline3D | Line3D | Path3D | Polyline3D | Polygon3D | Spline3D
    ),
) -> BRep3D

Create wire body from the curve as one edge

Parameters:

Returns:

  • BRep3D

    created BRep3D element

DeleteFace

DeleteFace(faceIndex: int) -> eGeometryErrorCode

Delete face from brep

Parameters:

  • faceIndex (int) –

    index of face we want to delete

Returns:

DeleteFaces

DeleteFaces(faceIndices: VecULongList) -> eGeometryErrorCode

Delete faces from brep

Parameters:

Returns:

GetAllEdgesFlags

GetAllEdgesFlags() -> tuple[eGeometryErrorCode, list[int]]

Get flags of the all edges.

Returns:

GetAllFacesFlags

GetAllFacesFlags() -> tuple[eGeometryErrorCode, list[int]]

Get flags of the all faces.

Returns:

GetEdgeCount

GetEdgeCount() -> int

Get the edges count

Returns:

  • int

    size_t count of edges

GetEdgeCurves

GetEdgeCurves() -> tuple[eGeometryErrorCode, list[Any]]

get all edge curves as BSpline3D

Returns:

GetEdgeFaceIndices

GetEdgeFaceIndices(edge: int) -> tuple[eGeometryErrorCode, list[int]]

Get faces containing this edge (if any)

Parameters:

  • edge (int) –

    desired edge index

Returns:

GetEdgeGeometry

GetEdgeGeometry(edge: int) -> Any

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:

GetEdgeParametricGeometry

GetEdgeParametricGeometry(edge: int) -> Any

Get (trimmed) edge geometry as parametric curves

Parameters:

  • edge (int) –

    edge index

Returns:

  • Any

    handle to geometry curve

GetEdgeVertexIndices

GetEdgeVertexIndices(edge: int) -> tuple

Get vertex indices of the edge

Parameters:

  • edge (int) –

    edge index

Returns:

  • tuple

    error code,

  • tuple

    start vertex index,

  • tuple

    end vertex index

GetEdgeVertices

GetEdgeVertices(edge: int) -> tuple[eGeometryErrorCode, Point3D, Point3D]

get edge vertices

Parameters:

  • edge (int) –

    edge index

Returns:

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:

GetFaceBoundaryCurves

GetFaceBoundaryCurves(face: int) -> tuple[eGeometryErrorCode, list[Any]]

Get face boundary curves, curves are trimmed

Parameters:

  • face (int) –

    face index

Returns:

GetFaceCount

GetFaceCount() -> int

Get the faces count

Returns:

  • int

    size_t count of faces

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:

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:

GetFaceEdges

GetFaceEdges(faceIndex: int) -> tuple[eGeometryErrorCode, list[OrientedEdge]]

Get face edges together with their orientations

Parameters:

  • faceIndex (int) –

    face index

Returns:

GetFaceFlags

GetFaceFlags(face: int) -> int

Get flags of the face.

Parameters:

  • face (int) –

    face index

Returns:

  • int

    flags value

GetFaceGeometry

GetFaceGeometry(face: int) -> Any

Get surface geometry of the face

throw Exception in case of invalid input.

Parameters:

  • face (int) –

    face index

Returns:

  • Any

    surface geometry handle

GetFaceGeometryOrientation

GetFaceGeometryOrientation(face: int) -> bool

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:

GetFaceLoopsCount

GetFaceLoopsCount(face: int) -> int

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:

GetFaceVerticesIndices

GetFaceVerticesIndices(faceIndex: int) -> tuple[eGeometryErrorCode, list[int]]

Get indices of vertices for given face index

Parameters:

  • faceIndex (int) –

    index of face

Returns:

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:

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:

GetLoopFins

GetLoopFins(loop: int) -> tuple[eGeometryErrorCode, list[int]]

Get fins from given loop

Parameters:

  • loop (int) –

    loop to find fins

Returns:

GetParts

GetParts() -> tuple[eGeometryErrorCode, list[BRep3D]]

Get separated parts (continuos shells)

Returns:

GetPartsCount

GetPartsCount() -> int

Get number of parts in this body

Returns:

  • int

    number of parts

GetPlanarFaces

GetPlanarFaces() -> list[tuple[Plane3D, int]]

Get planar faces if this brep contains planar faces

Returns:

  • list[tuple[Plane3D, int]]

    pairs of - surface geometry and surface index

GetRefPoint

GetRefPoint() -> Point3D

Get the reference point

Returns:

  • Point3D

    Constant reference point.

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:

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:

GetVertex

GetVertex(vertexIndex: int) -> tuple[eGeometryErrorCode, Point3D]

Get vertex geometry

Parameters:

  • vertexIndex (int) –

    vertex index

Returns:

GetVertexCount

GetVertexCount() -> int

Get the vertices count

Returns:

  • int

    count of vertices

GetVertexEdges

GetVertexEdges(vertex: int) -> tuple[eGeometryErrorCode, list[int]]

Get the edges containing given vertex

Parameters:

  • vertex (int) –

    Index of vertex

Returns:

GetVertexFaceIndices

GetVertexFaceIndices(vertexIndex: int) -> tuple[eGeometryErrorCode, list[int]]

Get indices of faces for given vertex index

Parameters:

  • vertexIndex (int) –

    index of vertex

Returns:

GetVertices

GetVertices() -> tuple[eGeometryErrorCode, list[Point3D]]

Get all vertices from brep

Returns:

GetVirtualVertices

GetVirtualVertices() -> tuple[eGeometryErrorCode, list[Point3D], list[int]]

Get vertices from edges without vertex (get start points of edge curves)

Returns:

GetVirtualVerticesCount

GetVirtualVerticesCount() -> int

Get count of vertices (count of edges without vertex)

Returns:

  • int

    count of vertices (edges without vertex)

HasPlanarFaces

HasPlanarFaces() -> bool

Check if this brep contains planar faces

Returns:

  • bool

    bool true = yes

InvertAllEdgesFlags

InvertAllEdgesFlags()

Invert flags for the all edges

InvertAllFacesFlags

InvertAllFacesFlags()

Invert flags for the all faces

IsClosed

IsClosed() -> bool

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)

IsEmpty

IsEmpty() -> bool

Returns true if the body is empty

Returns:

  • bool

    bool

IsFaceNaturallyTrimmed

IsFaceNaturallyTrimmed(face: int) -> bool

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

IsPolyhedron() -> bool

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)

IsValid

IsValid() -> bool

check whether data is valid

Returns:

  • bool

    bool true = is valid

IsWire

IsWire() -> bool

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]

Pick the edge under cursor

Parameters:

  • rayPoint (Point3D) –

    ray point

  • rayVector (Vector3D) –

    ray vector

  • searchRadius (float) –

    search radius

Returns:

  • tuple[bool, int, float, Point3D]

    tuple(true if any edge under cursor found, index of found edge, minimal distance between edge and ray, nearest point on ray from edge)

PickEdges

PickEdges(
    rayPoint: Point3D, rayVector: Vector3D, searchRadius: float
) -> tuple[bool, list[int], list[float], list[Point3D]]

Pick the edges under cursor

Parameters:

  • rayPoint (Point3D) –

    ray point

  • rayVector (Vector3D) –

    ray vector

  • searchRadius (float) –

    search radius

Returns:

  • tuple[bool, list[int], list[float], list[Point3D]]

    tuple(true if any edge under cursor found, index of found edge, minimal distance between edge and ray, nearest point on ray from edge)

PickFace

PickFace(rayPoint: Point3D, rayVector: Vector3D) -> tuple[bool, int, Point3D]

Pick the face under cursor

Parameters:

Returns:

  • tuple[bool, int, Point3D]

    tuple(true if any face under cursor found, index of found face, nearest point on ray from face (intersection point))

PickVertex

PickVertex(
    rayPoint: Point3D, rayVector: Vector3D, searchRadius: float
) -> tuple[bool, int, float, Point3D]

Pick the vertex under cursor

Parameters:

  • rayPoint (Point3D) –

    ray point

  • rayVector (Vector3D) –

    ray vector

  • searchRadius (float) –

    search radius

Returns:

  • tuple[bool, int, float, Point3D]

    tuple(true if any vertex under cursor found, index of found vertex, minimal distance between vertex and ray, nearest point on ray from vertex)

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:

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:

Reverse

Reverse() -> eGeometryErrorCode

Reverse the orientation of BRep

Returns:

SetAllEdgesFlags

SetAllEdgesFlags(flags: int)

Set flags to the all edges.

Parameters:

  • flags (int) –

    flags value

SetAllFacesFlags

SetAllFacesFlags(flags: int)

Set flags to the all faces.

Parameters:

  • flags (int) –

    flags value

SetFaceFlags

SetFaceFlags(face: int, flags: int)

Set flags to the face.

Parameters:

  • face (int) –

    face index

  • flags (int) –

    flags value

SetRefPoint

SetRefPoint(refPoint: Point3D)

Set the reference point

Parameters:

  • refPoint (Point3D) –

    New reference point.

WriteToStream

WriteToStream() -> tuple[eGeometryErrorCode, str, Matrix3D]

Write BRep3D to the text

Returns:

WriteToStreamSplitTransform

WriteToStreamSplitTransform() -> (
    tuple[eGeometryErrorCode, str, float, Vector3D, MinMax3D, MinMax3D]
)

Write BRep3D to the text, get transform parameters and minmax

Returns:

__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.

__init__ overloaded

__init__()

Initialize

__init__(brep: BRep3D)

Copy constructor

Parameters:

  • brep (BRep3D) –

    BRep3D which will be copied.

__repr__

__repr__() -> str

Convert to string

Placeholder