OpenCascade.js
API ReferenceModelingAlgorithmsTKPrim

BRepPrim

OCCT package BRepPrim: BRepPrim_Builder, BRepPrim_Cone, BRepPrim_Cylinder, BRepPrim_Direction, and 7 more bound classes.

BRepPrim_Builder

implements the abstract Builder with the BRep Builder

Constructors(2)

Instance methods(22)

  • Make a empty Shell.

    Parameters (1)
    • S
      Mutated in place; read the updated value from this argument after the call.
  • Returns in <F> a Face built with the plane equation.
    . Used by all primitives.

    Parameters (2)
    • F
      Mutated in place; read the updated value from this argument after the call.
    • P
  • Returns in <W> an empty Wire.

    Parameters (1)
    • W
      Mutated in place; read the updated value from this argument after the call.
  • Returns in <E> a degenerated edge.

    Parameters (1)
    • E
      Mutated in place; read the updated value from this argument after the call.
  • Returns in <E> an Edge built with the line equation <L>.

    Parameters (2)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • L
  • Returns in <E> an Edge built with the circle equation .

    Parameters (2)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • C
  • Sets the line <L> to be the curve representing the edge <E> in the parametric space of the surface of <F>.

    Parameters (3)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • F
    • L
  • Sets the circle to be the curve representing the edge <E> in the parametric space of the surface of <F>.

    Parameters (3)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • F
    • C
  • Sets the lines <L1,L2> to be the curves representing the edge <E> in the parametric space of the closed surface of <F>.

    Parameters (4)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • F
    • L1
    • L2
  • Returns in <V> a Vertex built with the point.
    .

    Parameters (2)
    • V
      Mutated in place; read the updated value from this argument after the call.
    • P
  • Reverses the Face <F>.

    Parameters (1)
    • F
      Mutated in place; read the updated value from this argument after the call.
  • AddEdgeVertex(E: TopoDS_Edge, V: TopoDS_Vertex, P: number, direct: boolean): void

    Adds the Vertex <V> in the Edge <E>.
    is the parameter of the vertex on the edge. If direct is False the Vertex is reversed.

    Parameters (4)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • V
    • P
    • direct
  • AddEdgeVertex(E: TopoDS_Edge, V: TopoDS_Vertex, P1: number, P2: number): void

    Adds the Vertex <V> in the Edge <E>. <P1,P2> are the parameters of the vertex on the closed edge.

    Parameters (4)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • V
    • P1
    • P2
  • SetParameters(E: TopoDS_Edge, V: TopoDS_Vertex, P1: number, P2: number): void

    <P1,P2> are the parameters of the vertex on the edge. The edge is a closed curve.

    Parameters (4)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • V
    • P1
    • P2
  • AddWireEdge(W: TopoDS_Wire, E: TopoDS_Edge, direct: boolean): void

    Adds the Edge <E> in the Wire <W>, if direct is False the Edge is reversed.

    Parameters (3)
    • W
      Mutated in place; read the updated value from this argument after the call.
    • E
    • direct
  • Adds the Wire <W> in the Face <F>.

    Parameters (2)
    • F
      Mutated in place; read the updated value from this argument after the call.
    • W
  • Adds the Face <F> in the Shell <Sh>.

    Parameters (2)
    • Sh
      Mutated in place; read the updated value from this argument after the call.
    • F
  • This is called once an edge is completed. It gives the opportunity to perform any post treatment.

    Parameters (1)
    • E
      Mutated in place; read the updated value from this argument after the call.
  • This is called once a wire is completed. It gives the opportunity to perform any post treatment.

    Parameters (1)
    • W
      Mutated in place; read the updated value from this argument after the call.
  • This is called once a face is completed. It gives the opportunity to perform any post treatment.

    Parameters (1)
    • F
      Mutated in place; read the updated value from this argument after the call.
  • This is called once a shell is completed. It gives the opportunity to perform any post treatment.

    Parameters (1)
    • S
      Mutated in place; read the updated value from this argument after the call.

BRepPrim_Cone

Implement the cone primitive.

Constructors(7)

  • constructor(Angle: number): BRepPrim_Cone

    infinite cone at origin on Z negative

    Parameters (1)
    • Angle
  • constructor(Angle: number, Apex: gp_Pnt): BRepPrim_Cone

    infinite cone at Apex on Z negative

    Parameters (2)
    • Angle
    • Apex
  • constructor(Angle: number, Axes: gp_Ax2): BRepPrim_Cone

    infinite cone with Axes

    Parameters (2)
    • Angle
    • Axes
  • constructor(R1: number, R2: number, H: number): BRepPrim_Cone

    create a Cone at origin on Z axis, of height H, radius R1 at Z = 0, R2 at Z = H, X is the origin of angles. If R1 or R2 is 0 there is an apex. Otherwise, it is a truncated cone.
    Error : R1 and R2 < Resolution R1 or R2 negative std::abs(R1-R2) < Resolution H < Resolution H negative

    Parameters (3)
    • R1
    • R2
    • H
  • constructor(Angle: number, Position: gp_Ax2, Height: number, Radius?: number): BRepPrim_Cone

    the STEP definition Angle = semi-angle of the cone Position : the coordinate system Height : height of the cone. Radius : radius of truncated face at z = 0
    The apex is on z < 0
    Errors : Height < Resolution Angle < Resolution / Height Angle > PI/2 - Resolution / Height

    Parameters (4)
    • Angle
    • Position
    • Height
    • Radius
  • constructor(Center: gp_Pnt, R1: number, R2: number, H: number): BRepPrim_Cone

    same as above but at a given point

    Parameters (4)
    • Center
    • R1
    • R2
    • H
  • constructor(Axes: gp_Ax2, R1: number, R2: number, H: number): BRepPrim_Cone

    same as above with given axes system.

    Parameters (4)
    • Axes
    • R1
    • R2
    • H

Instance methods(1)

BRepPrim_Cylinder

Cylinder primitive.

Constructors(6)

  • infinite Cylinder at origin on Z negative

    Parameters (1)
    • Radius
  • constructor(Center: gp_Pnt, Radius: number): BRepPrim_Cylinder

    infinite Cylinder at Center on Z negative

    Parameters (2)
    • Center
    • Radius
  • constructor(Axes: gp_Ax2, Radius: number): BRepPrim_Cylinder

    infinite Cylinder at Axes on Z negative

    Parameters (2)
    • Axes
    • Radius
  • constructor(R: number, H: number): BRepPrim_Cylinder

    create a Cylinder at origin on Z axis, of height H and radius R Error : Radius < Resolution H < Resolution H negative

    Parameters (2)
    • R
    • H
  • constructor(Position: gp_Ax2, Radius: number, Height: number): BRepPrim_Cylinder

    the STEP definition Position : center of a Face and Axis Radius : radius of cylinder Height : distance between faces on positive side
    Errors : Height < Resolution Radius < Resolution

    Parameters (3)
    • Position
    • Radius
    • Height
  • constructor(Center: gp_Pnt, R: number, H: number): BRepPrim_Cylinder

    same as above but at a given point

    Parameters (3)
    • Center
    • R
    • H

Instance methods(1)

BRepPrim_FaceBuilder

The FaceBuilder is an algorithm to build a BRep Face from a Geom Surface.
The face covers the whole surface or the area delimited by UMin, UMax, VMin, VMax

Constructors(3)

Instance methods(5)

BRepPrim_GWedge

A wedge is defined by:
Axes: an Axis2 (coordinate system)
YMin, YMax the coordinates of the ymin and ymax rectangular faces parallel to the ZX plane (of the coordinate systems)
ZMin, ZMax, XMin, XMax the rectangular left (YMin) face parallel to the Z and X axes.
Z2Min, Z2Max, X2Min, X2Max the rectangular right (YMax) face parallel to the Z and X axes.
For a box Z2Min = ZMin, Z2Max = ZMax, X2Min = XMin, X2Max = XMax
The wedge can be open in the corresponding direction of its Boolean myInfinite

Constructors(4)

  • Default constructor.

  • constructor(B: BRepPrim_Builder, Axes: gp_Ax2, dx: number, dy: number, dz: number): BRepPrim_GWedge

    Creates a GWedge algorithm. <Axes> is the axis system for the primitive.
    XMin, YMin, ZMin are set to 0 XMax, YMax, ZMax are set to dx, dy, dz Z2Min = ZMin Z2Max = ZMax X2Min = XMin X2Max = XMax The result is a box dx,dy,dz should be positive

    Parameters (5)
    • B
    • Axes
    • dx
    • dy
    • dz
  • constructor(B: BRepPrim_Builder, Axes: gp_Ax2, dx: number, dy: number, dz: number, ltx: number): BRepPrim_GWedge

    Creates a GWedge primitive. <Axes> is the axis system for the primitive.
    XMin, YMin, ZMin are set to 0 XMax, YMax, ZMax are set to dx, dy, dz Z2Min = ZMin Z2Max = ZMax X2Min = ltx X2Max = ltx The result is a STEP right angular wedge dx,dy,dz should be positive ltx should not be negative

    Parameters (6)
    • B
    • Axes
    • dx
    • dy
    • dz
    • ltx
  • constructor(B: BRepPrim_Builder, Axes: gp_Ax2, xmin: number, ymin: number, zmin: number, z2min: number, x2min: number, xmax: number, ymax: number, zmax: number, z2max: number, x2max: number): BRepPrim_GWedge

    Create a GWedge primitive. <Axes> is the axis system for the primitive.
    all the fields are set to the corresponding value XYZMax - XYZMin should be positive ZX2Max - ZX2Min should not be negative

    Parameters (12)
    • B
    • Axes
    • xmin
    • ymin
    • zmin
    • z2min
    • x2min
    • xmax
    • ymax
    • zmax
    • z2max
    • x2max

Instance methods(27)

BRepPrim_OneAxis

Algorithm to build primitives with one axis of revolution.
The revolution body is described by:
A coordinate system (Ax2 from gp). The Z axis is the rotational axis.
An Angle around the Axis, When the Angle is 2*PI the primitive is not limited by planar faces. The U parameter range from 0 to Angle.
A parameter range VMin, VMax on the meridian.
A meridian: The meridian is a curve described by a set of deferred methods.
The topology consists of A shell, Faces, Wires, Edges and Vertices. Methods are provided to build all the elements. Building an element implies the automatic building of all its sub-elements.
So building the shell builds everything.
There are at most 5 faces:

  • The LateralFace.
  • The TopFace and the BottomFace.
  • The StartFace and the EndFace.

Instance methods(50)

  • SetMeridianOffset(MeridianOffset?: number): void

    The MeridianOffset is added to the parameters on the meridian curve and to the V values of the pcurves. This is used for the sphere for example, to give a range on the meridian edge which is not VMin, VMax.

    Parameters (1)
    • MeridianOffset
  • Returns the Ax2 from <me>.

  • Axes(A: gp_Ax2): void
    Parameters (1)
    • A
  • Angle(): number
  • Angle(A: number): void
    Parameters (1)
    • A
  • VMin(): number
  • VMin(V: number): void
    Parameters (1)
    • V
  • VMax(): number
  • VMax(V: number): void
    Parameters (1)
    • V
  • Returns a face with no edges. The surface is the lateral surface with normals pointing outward. The U parameter is the angle with the origin on the X axis. The V parameter is the parameter of the meridian.

  • Returns an edge with a 3D curve made from the meridian in the XZ plane rotated by <Ang> around the Z-axis. Ang may be 0 or myAngle.

    Parameters (1)
    • Ang
  • Sets the parametric curve of the edge <E> in the face <F> to be the 2d representation of the meridian.

    Parameters (2)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • F
  • Returns the meridian point at parameter <V> in the plane XZ.

    Parameters (1)
    • V
  • MeridianOnAxis(V: number): boolean

    Returns True if the point of parameter <V> on the meridian is on the Axis. Default implementation is std::abs(MeridianValue(V).X()) < Precision::Confusion().

    Parameters (1)
    • V
  • MeridianClosed(): boolean

    Returns True if the meridian is closed. Default implementation is: MeridianValue(VMin).IsEqual(MeridianValue(VMax), Precision::Confusion()).

  • VMaxInfinite(): boolean

    Returns True if VMax is infinite. Default Precision::IsPositiveInfinite(VMax);.

  • VMinInfinite(): boolean

    Returns True if VMin is infinite. Default Precision::IsNegativeInfinite(VMax);.

  • HasTop(): boolean

    Returns True if there is a top face.
    That is neither: VMaxInfinite() MeridianClosed() MeridianOnAxis(VMax)

  • HasBottom(): boolean

    Returns True if there is a bottom face.
    That is neither: VMinInfinite() MeridianClosed() MeridianOnAxis(VMin)

  • HasSides(): boolean

    Returns True if there are Start and End faces.
    That is: 2*PI - Angle > Precision::Angular()

  • Returns the Shell containing all the Faces of the primitive.

  • Returns the lateral Face. It is oriented toward the outside of the primitive.

  • Returns the top planar Face. It is Oriented toward the +Z axis (outside).

  • Returns the Bottom planar Face. It is Oriented toward the -Z axis (outside).

  • Returns the Face starting the slice, it is oriented toward the exterior of the primitive.

  • Returns the Face ending the slice, it is oriented toward the exterior of the primitive.

  • Returns the wire in the lateral face.

  • Returns the wire in the lateral face with the start edge.

  • Returns the wire with in lateral face with the end edge.

  • Returns the wire in the top face.

  • Returns the wire in the bottom face.

  • Returns the wire in the start face.

  • Returns the wire in the start face with the AxisEdge.

  • Returns the Wire in the end face.

  • Returns the Wire in the end face with the AxisEdge.

  • Returns the Edge built along the Axis and oriented on +Z of the Axis.

  • Returns the Edge at angle 0.

  • Returns the Edge at angle Angle. If !HasSides() the StartEdge and the EndEdge are the same edge.

  • Returns the linear Edge between start Face and top Face.

  • Returns the linear Edge between start Face and bottom Face.

  • Returns the linear Edge between end Face and top Face.

  • Returns the linear Edge between end Face and bottom Face.

  • Returns the edge at VMax. If MeridianClosed() the TopEdge and the BottomEdge are the same edge.

  • Returns the edge at VMin. If MeridianClosed() the TopEdge and the BottomEdge are the same edge.

  • Returns the Vertex at the Top altitude on the axis.

  • Returns the Vertex at the Bottom altitude on the axis.

  • Returns the vertex (0,VMax).

  • Returns the vertex (angle,VMax).

  • Returns the vertex (0,VMin).

  • Returns the vertex (angle,VMax).

BRepPrim_Revolution

Implement the OneAxis algorithm for a revolution surface.

Constructors(1)

Instance methods(4)

  • The surface normal should be directed towards the outside.

  • Returns an edge with a 3D curve made from the meridian in the XZ plane rotated by <Ang> around the Z-axis. Ang may be 0 or myAngle.

    Parameters (1)
    • Ang
  • Returns the meridian point at parameter <V> in the plane XZ.

    Parameters (1)
    • V
  • Sets the parametric urve of the edge <E> in the face <F> to be the 2d representation of the meridian.

    Parameters (2)
    • E
      Mutated in place; read the updated value from this argument after the call.
    • F

BRepPrim_Sphere

Implements the sphere primitive.

Constructors(3)

  • constructor(Radius: number): BRepPrim_Sphere

    Creates a Sphere at origin with Radius. The axes of the sphere are the reference axes. An error is raised if the radius is < Resolution.

    Parameters (1)
    • Radius
  • constructor(Center: gp_Pnt, Radius: number): BRepPrim_Sphere

    Creates a Sphere with Center and Radius. Axes are the reference axes. This is the STEP constructor.

    Parameters (2)
    • Center
    • Radius
  • constructor(Axes: gp_Ax2, Radius: number): BRepPrim_Sphere

    Creates a sphere with given axes system.

    Parameters (2)
    • Axes
    • Radius

Instance methods(1)

BRepPrim_Torus

Implements the torus primitive.

Constructors(3)

  • constructor(Major: number, Minor: number): BRepPrim_Torus

    Torus centered at origin.

    Parameters (2)
    • Major
    • Minor
  • constructor(Position: gp_Ax2, Major: number, Minor: number): BRepPrim_Torus

    the STEP definition Position : center and axes Major, Minor : Radii
    Errors : Major < Resolution Minor < Resolution

    Parameters (3)
    • Position
    • Major
    • Minor
  • constructor(Center: gp_Pnt, Major: number, Minor: number): BRepPrim_Torus

    Torus at Center.

    Parameters (3)
    • Center
    • Major
    • Minor

Instance methods(1)

BRepPrim_Wedge

Provides constructors without Builders.

Constructors(4)

  • Default constructor.

  • constructor(Axes: gp_Ax2, dx: number, dy: number, dz: number): BRepPrim_Wedge

    Creates a Wedge algorithm. <Axes> is the axis system for the primitive.
    XMin, YMin, ZMin are set to 0 XMax, YMax, ZMax are set to dx, dy, dz Z2Min = ZMin Z2Max = ZMax X2Min = XMin X2Max = XMax The result is a box dx,dy,dz should be positive

    Parameters (4)
    • Axes
    • dx
    • dy
    • dz
  • constructor(Axes: gp_Ax2, dx: number, dy: number, dz: number, ltx: number): BRepPrim_Wedge

    Creates a Wedge primitive. <Axes> is the axis system for the primitive.
    XMin, YMin, ZMin are set to 0 XMax, YMax, ZMax are set to dx, dy, dz Z2Min = ZMin Z2Max = ZMax X2Min = ltx X2Max = ltx The result is a STEP right angular wedge dx,dy,dz should be positive ltx should not be negative

    Parameters (5)
    • Axes
    • dx
    • dy
    • dz
    • ltx
  • constructor(Axes: gp_Ax2, xmin: number, ymin: number, zmin: number, z2min: number, x2min: number, xmax: number, ymax: number, zmax: number, z2max: number, x2max: number): BRepPrim_Wedge

    Create a Wedge primitive. <Axes> is the axis system for the primitive.
    all the fields are set to the corresponding value XYZMax - XYZMin should be positive ZX2Max - ZX2Min should not be negative

    Parameters (11)
    • Axes
    • xmin
    • ymin
    • zmin
    • z2min
    • x2min
    • xmax
    • ymax
    • zmax
    • z2max
    • x2max