communicator Reference
References
Enumerations
- AntiAliasingMode
- AttributeType
- Axis
- BasicUnit
- BlurIntervalUnit
- BoundingPreviewMode
- BranchVisibility
- BuiltinOverlayIndex
- Button
- Buttons
- CullingVectorSpace
- DepthRange
- DrawMode
- DrawStrategy
- ElementType
- EventType
- FaceWinding
- FileType
- FilterId
- FloorplanOrientation
- HandleEventType
- HandleType
- ImageFormat
- InfoType
- InstanceModifier
- KeyCode
- KeyInputType
- KeyModifiers
- LayerId
- LinePatternLengthUnit
- MeshInstanceCreationFlags
- MouseInputType
- NodeSource
- NodeType
- OperatorId
- OrbitFallbackMode
- OverlayAnchor
- OverlayUnit
- PmiSubType
- PmiTopoRef
- PmiType
- PointShape
- PointSizeUnit
- Projection
- RelationshipType
- RendererType
- ScreenConfiguration
- SelectionHighlightMode
- SelectionMask
- SelectionMode
- SelectionType
- SimpleReflectionAttenuationUnit
- SnapshotLayer
- StreamingMode
- TextureModifier
- TextureParameterization
- TextureTiling
- TouchInputType
- TransparencyMode
- TreeWalkMode
- ViewOrientation
- WalkDirection
- WalkMode
- XRayGroup
Classes
AssemblyDataParseError()
AxisTriad()
Box()
Camera()
Color()
CommunicatorError()
CuttingManager()
CuttingPlane()
CuttingSection()
DirectionalLight()
ExplodeManager()
FaceFaceDistanceItem()
FaceMeshData()
FilteredNodes()
IncrementalPickConfig()
InternalLogicError()
InvalidIndexError()
InvalidNodeIdError()
InvalidNodeTypeError()
Light()
LineManager()
LoadCancelledError()
LoadError()
LoadSubtreeConfig()
MarkupManager()
MarkupTypeManager()
Matrix()
MeasureManager()
MeshData()
MeshInstanceData()
MissingModelError()
Model()
NavCube()
OperatorManager()
ParseError()
PickConfig()
PickOutsideCanvasError()
Plane()
Point2()
Point3()
Point4()
PointLight()
PointMeshData()
PolylineMeshData()
Ray()
RefOnTopoItem()
SelectionInvalidatedError()
SheetManager()
SnapshotConfig()
SubentityAttributes()
SvgConfig()
VerticalGradient()
View()
ViewAxes()
VisibilityState()
WebViewer()
XmlParseError()
Interfaces
Attribute()
BloomLayerInfo()
CallbackMap()
ComparisonConfig()
CullingVector()
CuttingPlaneData()
FaceFaceDistanceObject()
GetNodesBoundingConfig()
GroundPlane()
IBox()
IColor()
IdBooleanMap()
IdColorMap()
IdNumberMap()
IdStringMap()
ImageBasedLightingOrientation()
ImageOptions()
IPoint2()
IPoint3()
IPoint4()
IRay()
MarkupData()
MeshDataCopy()
MeshDataCopyElement()
MeshDataCopyElementGroup()
MeshDataCopyIterator()
MeshDataCopyVertex()
MetallicRoughnessValue()
ObjectConstructor()
RelationshipInfo()
SimpleReflectionAttenuation()
StringStringMap()
TextureOptions()
UnitElement()
ViewConfig()
WebViewerConfig()
Type Aliases
- BimId
- BodyId
- BuiltInOperatorId
- CadViewId
- Degrees
- ExchangeId
- ExternalModelName
- FilterName
- GenericId
- GenericType
- HtmlId
- ImageId
- LayerName
- LightKey
- LinePattern
- MassageModelNameFunc
- Matrix12
- Matrix16
- Matrix9
- MeshId
- ModelNameToScsFileFunc
- NodeId
- NodeIdOffset
- PartId
- Pixels
- PmiId
- Radians
- Rgbas
- ScsUri
- SheetId
- UserDataIndex
- Uuid
- Uvs
- Vector3
- Vector3s
- Vector4
- Vector4s
- XmlFilename
- XRayTransparencyMode
Variables
Functions
closestPointFromPointToSegment()
closestPointScalarFromPointToSegment()
computeAngleBetweenVector()
computeOffaxisRotation()
computePointToLineDistance()
createUuid()
degreesToRadians()
distanceLineLine()
formatWithUnit()
generateArcPoints()
generatePointsOnCircle()
get3dBaseFromVector()
getLongUnitString()
getOrthogonalVector()
intersect3d2Planes()
intersectionPlaneLine()
intersectionPlaneLine2()
isIColor()
isIPoint2()
isIPoint3()
isIPoint4()
isPointInRect2d()
isPointOnLineSegment()
isPointOnLineSegment2d()
lineLineIntersect()
oneVectorCross()
radiansToDegrees()
sortVerticesCounterClockwise()
References
Milliseconds
Re-exports Milliseconds
OverlayId
Re-exports OverlayId()
OverlayIndex
Re-exports OverlayIndex
ScModelName
Re-exports ScModelName
Type Aliases
BimId
Type for the relationships ID
BodyId
Type used to denote assembly tree body IDs. All BodyIds are NodeIds.
BuiltInOperatorId
Enumerates IDs for built-in operators
CadViewId
Type used to denote assembly tree CAD view IDs. All CadViewIds are NodeIds.
Degrees
Type used to denote the degrees of angles.
ExchangeId
Type used to denote Exchange IDs. Use [[Util.exchangeIdEqual]] function to compare.
ExternalModelName
Type used to denote an XML ExternalModel name.
FilterName
Type used to denote Filter names.
GenericId
Type used to denote generic id
GenericType
Type used to denote generic types
HtmlId
Type used to denote HTML IDs.
ImageId
A pair of numbers identifying an image.
LayerName
Type used to denote Layer names.
LightKey
Type used to denote light keys
LinePattern
Specifies the appearance of a single repetion of a line pattern.
The format is an arbitrary-length array of 1``s and ``0``s, where
pixels covered by a ``1
in the pattern are visible and pixels
covered by a 0
are invisible.
Examples:
- [1,0]
: a dashed line with equal-length dashes and gaps
- [1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,0,0,0]
: a dash followed by a gap of
equal length with a dot in the center
MassageModelNameFunc
Callback to massage ExternalModel names within an XML load file to SC model names. Return null to skip the model. Returned value can be synchronous (non-Promise) or asynchronous (Promise).
Matrix12
Matrix16
Matrix9
MeshId
A pair of numbers identifying a mesh.
ModelNameToScsFileFunc
Callback to map ExternalModel names within an XML load file to SCS file URis or SCS file buffers. Return null to skip the model. Returned value can be synchronous (non-Promise) or asynchronous (Promise).
NodeId
Type used to denote assembly tree node IDs.
NodeIdOffset
PartId
Type used to denote assembly tree part IDs. All PartIds are NodeIds.
Pixels
A number typed in pixel units.
PmiId
Type used to denote assembly tree PMI IDs. All PmiIds are NodeIds.
Radians
Type used to denote the radians of angles.
Rgbas
ScsUri
Type used to denote an SCS model’s URI.
SheetId
Type used to denote assembly tree sheet IDs. All SheetIds are NodeIds.
UserDataIndex
This is the User Data Index for a node.
Values of this type are unsigned 64 bit numbers.
A value is of type number
when it can be represented precisely as such.
Otherwise a value is of type string
, where the string is the hex encoding of the index.
The hex representation is in uppercase and does not have a leading 0x
.
Uuid
Type used to denote GUIDs.
Uvs
Vector3
Vector3s
Vector4
Vector4s
XmlFilename
Type used to denote an XML filename.
XRayTransparencyMode
Enumerates ways of displaying transparent (unselected) geometry in the x-ray draw mode.
Variables
-
DefaultTransitionDuration
Type: 400 The default duration in milliseconds of camera transitions.
-
EmptyModelName
Type: _empty
-
InvalidNodeId
Type: NodeId
-
Ohm
Type: Ω
-
Subscript1
Type: ¹
-
Subscript2
Type: ²
-
Subscript3
Type: ³
-
SubscriptNeg
Type: ⁻
Functions
closestPointFromPointToSegment
-
closestPointFromPointToSegment
(p0, p1, point) Arguments: Finds the closest point on line segment p0-p1 to the given point. The closest point will always lie on or between the line segment endpoints.
Return type: Point3
closestPointScalarFromPointToSegment
-
closestPointScalarFromPointToSegment
(p0, p1, point) Arguments: Finds the scalar for the closest point on line segment p0-p1 to the given point. The returned scalar will always be in the range [0, 1], where 0 indicates p0 is closest, and 1 indicates p1 is closest.
Return type: number
computeAngleBetweenVector
computeOffaxisRotation
-
computeOffaxisRotation
(axisVector, degrees[, out_rotationMatrix]) Arguments: Computes the rotation matrix defined by rotating around a vector.
Returns: The out parameter rotation matrix. Return type: Matrix
computePointToLineDistance
-
computePointToLineDistance
(point, lineBegin, lineEnd, out_closestPointOnLine) Arguments: Computes the shortest distance between a point and a line segment.
Returns: The distance from the point and the closest point on the line. Return type: number
degreesToRadians
-
degreesToRadians
(degrees) Arguments: - degrees (
number()
) – The degrees to convert.
Converts degrees to radians.
Returns: The converted radians. Return type: number - degrees (
distanceLineLine
-
distanceLineLine
(line1Begin, line1End, line2Begin, line2End, out_closestPointLine1, out_closestPointLine2) Arguments: - line1Begin (
Point3()
) – The start of the first line segment. - line1End (
Point3()
) – The end of the first line segment. - line2Begin (
Point3()
) – The start of the second line segment. - line2End (
Point3()
) – The end of the second line segment. - out_closestPointLine1 (
Point3()
) – Out parameter for the closest point of line1 to line2. - out_closestPointLine2 (
Point3()
) – Out parameter for the closest point of line2 to line1.
Returns the distance between two line segments.
Returns: The distance between the two input line segments. Return type: number - line1Begin (
formatWithUnit
-
formatWithUnit
(value, unit) Arguments: - value (
number()
) – The value to format (without units). - unit (
number()
) – The unit scale to be applied tovalue
.
Returns the formatted string of a value and its units. Unit scaling is based on
unit === 1
being for millimeters.Return type: string - value (
generateArcPoints
-
generateArcPoints
(axis, angle, center, startOffset, segmentCount) Arguments: - axis (
Point3()
) – The normal of the plane containing the arc (in other words, the axis of rotation). - angle (
number()
) – The angle swept by the arc (may be negative). - center (
Point3()
) – The center point of the arc. - startOffset (
Point3()
) – The starting point of the arc, expressed as an offset relative to the center. - segmentCount (
number()
) – The number of line segments to be generated.
Returns an array of evenly-distributed points that lie on an arc.
Returns: An array containing segmentCount + 1
points.Return type: [Point3] - axis (
generatePointsOnCircle
-
generatePointsOnCircle
(out_points, center, radius, numPoints, axisVector) Arguments: - out_points (
[Point3]()
) – The out parameter for the generated points. - center (
Point3()
) – The center of the circle. - radius (
number()
) – The radius of the circle. - numPoints (
number()
) – The number of points to use for the tesesselated circle. - axisVector (
Point3()
) – The axis to orient the circle against.
Generates tessellated points suitable for mesh creation for a given circle.
Return type: void - out_points (
get3dBaseFromVector
-
get3dBaseFromVector
(normal) Arguments: - normal (
IPoint3()
) – The input normal vector from which to generate the 3D basis.
Generates a 3D orthonormal basis from a given normal vector.
This function takes a normal vector, normalizes it, and then computes an orthogonal vector to it. Finally, it returns an array containing the normalized normal vector, the orthogonal vector, and their cross product, which forms an orthonormal basis.
Returns: An array of three IPoint3 vectors representing the orthonormal basis. Return type: [IPoint3] - normal (
getLongUnitString
-
getLongUnitString
(unit) Arguments: - unit (
[UnitElement]()
) – None
Return type: string
- unit (
getOrthogonalVector
-
getOrthogonalVector
(v) Arguments: - v (
IPoint3()
) – The input vector for which to find an orthogonal vector.
Computes an orthogonal vector to the given 3D vector.
Returns: An orthogonal vector to the input vector. Throws: Will throw an error if the input vector is a zero vector. Example: Return type: IPoint3 - v (
intersect3d2Planes
-
intersect3d2Planes
(plane1, pointOnPlane1, plane2, pointOnPlane2, out_lineBegin, out_lineEnd) Arguments: - plane1 (
Plane()
) – The first plane. - pointOnPlane1 (
Point3()
) – A point on the first plane. - plane2 (
Plane()
) – The second plane. - pointOnPlane2 (
Point3()
) – A point on the second plane. - out_lineBegin (
Point3()
) – Out parameter for resulting intersection line (if any). - out_lineEnd (
Point3()
) – Out parameter for resulting intersection line (if any).
Computes the intersection of two planes.
Returns: 0
if the planes are disjoint.1
if the planes coincide.2
if the planes intersect in a line.Return type: 0 | 1 | 2 - plane1 (
intersectionPlaneLine
-
intersectionPlaneLine
(lineBegin, lineEnd, planePoint1, planePoint2, planePoint3, out_intersectionPoint) Arguments: - lineBegin (
Point3()
) – The start point of the line segment to intersect. - lineEnd (
Point3()
) – The end point of the line segment to intersect. - planePoint1 (
Point3()
) – A point on the plane to intersect. - planePoint2 (
Point3()
) – A point on the plane to intersect. - planePoint3 (
Point3()
) – A point on the plane to intersect. - out_intersectionPoint (
Point3()
) – The out parameter for the point of intersection if one exists.
Computes the intersection of a line segment and a plane.
Returns: True if the line segment and plane intersect. False otherwise. See also: [[intersectionPlaneLine2]]. Return type: boolean - lineBegin (
intersectionPlaneLine2
-
intersectionPlaneLine2
(lineBegin, lineEnd, plane, out_intersectionPoint) Arguments: Computes the intersection of a line segment and a plane.
Returns: True if the line segment and plane intersect. False otherwise. Return type: boolean
isPointInRect2d
-
isPointInRect2d
(point, rectPos, rectSize, tolerance) Arguments: Returns whether the 2-dimensional point
point
lies within the given rectangle.Return type: boolean
isPointOnLineSegment
-
isPointOnLineSegment
(p0, p1, point, epsilon) Arguments: Determine if the point is both on the line formed by p0-p1, and within the p0-p1 line-segment endpoints
Return type: boolean
isPointOnLineSegment2d
-
isPointOnLineSegment2d
(point, p1, p2, tolerance) Arguments: Returns whether the 2-dimensional point
point
lies on the line segmentp1p2
.Return type: boolean
lineLineIntersect
oneVectorCross
radiansToDegrees
-
radiansToDegrees
(radians) Arguments: - radians (
number()
) – None
Converts radians to degrees.
Returns: The converted degrees. Return type: number - radians (
sortVerticesCounterClockwise
-
sortVerticesCounterClockwise
(vertices, base) Arguments: - vertices (
[IPoint3]()
) – An array of vertices to be sorted. - base (
[IPoint3]()
) – A base array used to determine the sorting order.
Sorts an array of vertices in counter-clockwise order around their centroid.
Returns: A new array of vertices sorted in counter-clockwise order. Return type: [IPoint3] - vertices (