OpenCascade.js
API ReferenceModelingAlgorithmsTKHLR

HLRAlgo

OCCT package HLRAlgo: HLRAlgo, HLRAlgo_BiPoint, HLRAlgo_BiPoint_PointsT, HLRAlgo_EdgeIterator, and 15 more bound classes.

HLRAlgo

In order to have the precision required in industrial design, drawings need to offer the possibility of removing lines, which are hidden in a given projection.
To do this, the Hidden Line Removal component provides two algorithms: HLRBRep_Algo and HLRBRep_PolyAlgo. These algorithms remove or indicate lines hidden by surfaces. For a given projection, they calculate a set of lines characteristic of the object being represented.
They are also used in conjunction with extraction utilities, which reconstruct a new, simplified shape from a selection of calculation results. This new shape is made up of edges, which represent the lines of the visualized shape in a plane.
This plane is the projection plane. HLRBRep_Algo takes into account the shape itself. HLRBRep_PolyAlgo works with a polyhedral simplification of the shape.
When you use HLRBRep_Algo, you obtain an exact result, whereas, when you use HLRBRep_PolyAlgo, you reduce computation time but obtain polygonal segments.

Constructors(1)

Static methods(8)

HLRAlgo_BiPoint

Constructors(7)

  • constructor(X1: number, Y1: number, Z1: number, X2: number, Y2: number, Z2: number, XT1: number, YT1: number, ZT1: number, XT2: number, YT2: number, ZT2: number, Index: number, flag: number): HLRAlgo_BiPoint
    Parameters (14)
    • X1
    • Y1
    • Z1
    • X2
    • Y2
    • Z2
    • XT1
    • YT1
    • ZT1
    • XT2
    • YT2
    • ZT2
    • Index
    • flag
  • constructor(X1: number, Y1: number, Z1: number, X2: number, Y2: number, Z2: number, XT1: number, YT1: number, ZT1: number, XT2: number, YT2: number, ZT2: number, Index: number, reg1: boolean, regn: boolean, outl: boolean, intl: boolean): HLRAlgo_BiPoint
    Parameters (17)
    • X1
    • Y1
    • Z1
    • X2
    • Y2
    • Z2
    • XT1
    • YT1
    • ZT1
    • XT2
    • YT2
    • ZT2
    • Index
    • reg1
    • regn
    • outl
    • intl
  • constructor(X1: number, Y1: number, Z1: number, X2: number, Y2: number, Z2: number, XT1: number, YT1: number, ZT1: number, XT2: number, YT2: number, ZT2: number, Index: number, i1: number, i1p1: number, i1p2: number, flag: number): HLRAlgo_BiPoint
    Parameters (17)
    • X1
    • Y1
    • Z1
    • X2
    • Y2
    • Z2
    • XT1
    • YT1
    • ZT1
    • XT2
    • YT2
    • ZT2
    • Index
    • i1
    • i1p1
    • i1p2
    • flag
  • constructor(X1: number, Y1: number, Z1: number, X2: number, Y2: number, Z2: number, XT1: number, YT1: number, ZT1: number, XT2: number, YT2: number, ZT2: number, Index: number, i1: number, i1p1: number, i1p2: number, reg1: boolean, regn: boolean, outl: boolean, intl: boolean): HLRAlgo_BiPoint
    Parameters (20)
    • X1
    • Y1
    • Z1
    • X2
    • Y2
    • Z2
    • XT1
    • YT1
    • ZT1
    • XT2
    • YT2
    • ZT2
    • Index
    • i1
    • i1p1
    • i1p2
    • reg1
    • regn
    • outl
    • intl
  • constructor(X1: number, Y1: number, Z1: number, X2: number, Y2: number, Z2: number, XT1: number, YT1: number, ZT1: number, XT2: number, YT2: number, ZT2: number, Index: number, i1: number, i1p1: number, i1p2: number, i2: number, i2p1: number, i2p2: number, flag: number): HLRAlgo_BiPoint
    Parameters (20)
    • X1
    • Y1
    • Z1
    • X2
    • Y2
    • Z2
    • XT1
    • YT1
    • ZT1
    • XT2
    • YT2
    • ZT2
    • Index
    • i1
    • i1p1
    • i1p2
    • i2
    • i2p1
    • i2p2
    • flag
  • constructor(X1: number, Y1: number, Z1: number, X2: number, Y2: number, Z2: number, XT1: number, YT1: number, ZT1: number, XT2: number, YT2: number, ZT2: number, Index: number, i1: number, i1p1: number, i1p2: number, i2: number, i2p1: number, i2p2: number, reg1: boolean, regn: boolean, outl: boolean, intl: boolean): HLRAlgo_BiPoint
    Parameters (23)
    • X1
    • Y1
    • Z1
    • X2
    • Y2
    • Z2
    • XT1
    • YT1
    • ZT1
    • XT2
    • YT2
    • ZT2
    • Index
    • i1
    • i1p1
    • i1p2
    • i2
    • i2p1
    • i2p2
    • reg1
    • regn
    • outl
    • intl

Instance methods(12)

HLRAlgo_EdgeIterator

Constructors(1)

Instance methods(8)

  • Parameters (1)
    • status
  • MoreHidden(): boolean
  • NextHidden(): void
  • Hidden(Start: number, TolStart: number, End: number, TolEnd: number): { Start: number; TolStart: number; End: number; TolEnd: number }

    Returns the bounds and the tolerances of the current Hidden Interval.

    Parameters (4)
    • Start
    • TolStart
    • End
    • TolEnd
    Returns

    A result object with fields:

    • Start: updated value from the call.
    • TolStart: updated value from the call.
    • End: updated value from the call.
    • TolEnd: updated value from the call.
  • Parameters (1)
    • status
  • MoreVisible(): boolean
  • NextVisible(): void
  • Visible(Start: number, TolStart: number, End: number, TolEnd: number): { Start: number; TolStart: number; End: number; TolEnd: number }

    Returns the bounds and the tolerances of the current Visible Interval.

    Parameters (4)
    • Start
    • TolStart
    • End
    • TolEnd
    Returns

    A result object with fields:

    • Start: updated value from the call.
    • TolStart: updated value from the call.
    • End: updated value from the call.
    • TolEnd: updated value from the call.

HLRAlgo_EdgesBlock

An EdgesBlock is a set of Edges. It is used by the DataStructure to structure the Edges.
An EdgesBlock contains:

  • An Array of index of Edges.
  • An Array of flagsf (Orientation OutLine Internal Double IsoLine)

Constructors(1)

Static methods(2)

Instance methods(16)

HLRAlgo_EdgeStatus

This class describes the Hidden Line status of an Edge. It contains:
The Bounds of the Edge and their tolerances
Two flags indicating if the edge is full visible or full hidden TheSequenceof visible Intervals on the Edge.

Constructors(2)

  • constructor(Start: number, TolStart: number, End: number, TolEnd: number): HLRAlgo_EdgeStatus

    Creates a new EdgeStatus. Default visible. The Edge is bounded by the interval <Start>, <End> with the tolerances <TolStart>, <TolEnd>.

    Parameters (4)
    • Start
    • TolStart
    • End
    • TolEnd

Instance methods(11)

  • Initialize(Start: number, TolStart: number, End: number, TolEnd: number): void

    Initialize an EdgeStatus. Default visible. The Edge is bounded by the interval <Start>, <End> with the tolerances <TolStart>, <TolEnd>.

    Parameters (4)
    • Start
    • TolStart
    • End
    • TolEnd
  • Bounds(theStart: number, theTolStart: number, theEnd: number, theTolEnd: number): { theStart: number; theTolStart: number; theEnd: number; theTolEnd: number }
    Parameters (4)
    • theStart
    • theTolStart
    • theEnd
    • theTolEnd
  • NbVisiblePart(): number
  • VisiblePart(Index: number, Start: number, TolStart: number, End: number, TolEnd: number): { Start: number; TolStart: number; End: number; TolEnd: number }
    Parameters (5)
    • Index
    • Start
    • TolStart
    • End
    • TolEnd
  • Hide(Start: number, TolStart: number, End: number, TolEnd: number, OnFace: boolean, OnBoundary: boolean): void

    Hides the interval <Start>, <End> with the tolerances <TolStart>, <TolEnd>. This interval is subtracted from the visible parts. If the hidden part is on (or under) the face the flag <OnFace> is True (or False). If the hidden part is on (or inside) the boundary of the face the flag <OnBoundary> is True (or False).

    Parameters (6)
    • Start
    • TolStart
    • End
    • TolEnd
    • OnFace
    • OnBoundary
  • HideAll(): void

    Hide the whole Edge.

  • ShowAll(): void

    Show the whole Edge.

  • AllHidden(): boolean
  • AllHidden(B: boolean): void
    Parameters (1)
    • B
  • AllVisible(): boolean
  • AllVisible(B: boolean): void
    Parameters (1)
    • B

HLRAlgo_Intersection

Describes an intersection on an edge to hide. Contains a parameter and a state (ON = on the face, OUT = above the face, IN = under the Face).

Constructors(2)

Instance methods(14)

HLRAlgo_PolyAlgo

to remove Hidden lines on Triangulations.

Constructors(1)

Static methods(2)

Instance methods(14)

  • Init(theNbShells: number): void
    Parameters (1)
    • theNbShells
  • Clear(): void
  • Update(): void

    Prepare all the data to process the algo.

  • InitHide(): void
  • MoreHide(): boolean
  • NextHide(): void
  • Hide(status: HLRAlgo_EdgeStatus, Index: number, reg1: boolean, regn: boolean, outl: boolean, intl: boolean): { returnValue: HLRAlgo_BiPoint_PointsT; Index: number; reg1: boolean; regn: boolean; outl: boolean; intl: boolean; [Symbol.dispose](): void }

    process hiding between <Pt1> and <Pt2>.

    Parameters (6)
    • status
      Mutated in place; read the updated value from this argument after the call.
    • Index
    • reg1
    • regn
    • outl
    • intl
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • Index: updated value from the call.
    • reg1: updated value from the call.
    • regn: updated value from the call.
    • outl: updated value from the call.
    • intl: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.
  • InitShow(): void
  • MoreShow(): boolean
  • NextShow(): void
  • Show(Index: number, reg1: boolean, regn: boolean, outl: boolean, intl: boolean): { returnValue: HLRAlgo_BiPoint_PointsT; Index: number; reg1: boolean; regn: boolean; outl: boolean; intl: boolean; [Symbol.dispose](): void }

    process hiding between <Pt1> and <Pt2>.

    Parameters (5)
    • Index
    • reg1
    • regn
    • outl
    • intl
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • Index: updated value from the call.
    • reg1: updated value from the call.
    • regn: updated value from the call.
    • outl: updated value from the call.
    • intl: updated value from the call.
      Dispose the returned envelope to release owned Handle fields.

HLRAlgo_PolyData

Data structure of a set of Triangles.

Constructors(1)

Static methods(2)

Instance methods(13)

HLRAlgo_PolyHidingData

Data structure of a set of Hiding Triangles.

Constructors(1)

Instance methods(3)

  • Set(Index: number, Minim: number, Maxim: number, A: number, B: number, C: number, D: number): void
    Parameters (7)
    • Index
    • Minim
    • Maxim
    • A
    • B
    • C
    • D
  • Indices(): HLRAlgo_PolyHidingData_TriangleIndices
  • Plane(): HLRAlgo_PolyHidingData_PlaneT

HLRAlgo_PolyMask

Properties(13)

HLRAlgo_PolyShellData

All the PolyData of a Shell.

Constructors(1)

Static methods(2)

Instance methods(8)

HLRAlgo_Projector

Implements a projector object. To transform and project Points and Planes. This object is designed to be used in the removal of hidden lines and is returned by the Prs3d_Projector::Projector function. You define the projection of the selected shape by calling one of the following functions:

  • HLRBRep_Algo::Projector, or
  • HLRBRep_PolyAlgo::Projector The choice depends on the algorithm, which you are using. The parameters of the view are defined at the time of construction of a Prs3d_Projector object.

Constructors(5)

Instance methods(14)

  • Set(T: gp_Trsf, Persp: boolean, Focus: number): void
    Parameters (3)
    • T
    • Persp
    • Focus
  • Directions(D1: gp_Vec2d, D2: gp_Vec2d, D3: gp_Vec2d): void
    Parameters (3)
    • D1
    • D2
    • D3
  • Scaled(On?: boolean): void

    to compute with the given scale and translation.

    Parameters (1)
    • On
  • Perspective(): boolean

    Returns True if there is a perspective transformation.

  • Returns the active transformation.

  • Returns the active inverted transformation.

  • Returns the original transformation.

  • Focus(): number

    Returns the focal length.

  • Transform(D: gp_Vec): void
    Parameters (1)
    • D
  • Transform(Pnt: gp_Pnt): void
    Parameters (1)
    • Pnt
  • Project(P: gp_Pnt, Pout: gp_Pnt2d): void

    Transform and apply perspective if needed.

    Parameters (2)
    • P
    • Pout
      Mutated in place; read the updated value from this argument after the call.
  • Project(P: gp_Pnt, X: number, Y: number, Z: number): { X: number; Y: number; Z: number }

    Transform and apply perspective if needed.

    Parameters (4)
    • P
    • X
    • Y
    • Z
    Returns

    A result object with fields:

    • X: updated value from the call.
    • Y: updated value from the call.
    • Z: updated value from the call.
  • Project(P: gp_Pnt, D1: gp_Vec, Pout: gp_Pnt2d, D1out: gp_Vec2d): void

    Transform and apply perspective if needed.

    Parameters (4)
    • P
    • D1
    • Pout
      Mutated in place; read the updated value from this argument after the call.
    • D1out
      Mutated in place; read the updated value from this argument after the call.
  • Shoot(X: number, Y: number): gp_Lin

    return a line going through the eye towards the 2d point <X,Y>.

    Parameters (2)
    • X
    • Y

HLRAlgo_WiresBlock

A WiresBlock is a set of Blocks. It is used by the DataStructure to structure the Edges.
A WiresBlock contains:

  • An Array of Blocks.

Constructors(1)

Static methods(2)

Instance methods(6)