new Junction( [x] [, y] [, z] [, config])
Creates a new path junction.
Parameters:
| Name | Type | Argument | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x |
number | THREE.Vector3 |
<optional> |
0 | The position in the X-axis, defaults to zero. |
||||||||||||||||||||||||||||||||||||||||||||
y |
number |
<optional> |
0 | The position in the Y-axis, defaults to zero. |
||||||||||||||||||||||||||||||||||||||||||||
z |
number |
<optional> |
0 | The position in the Z-axis, defaults to zero. |
||||||||||||||||||||||||||||||||||||||||||||
config |
object |
<optional> |
An optional configuration object. |
|||||||||||||||||||||||||||||||||||||||||||||
Properties of
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Name | Type | Argument | Description |
|---|---|---|---|
pos |
Array.<number> |
<optional> |
An optional vector array to override the x, y and z values. |
path |
BIM.Path |
<optional> |
An optional path that this junction belongs to, if any. |
curve |
PD.Curve |
<optional> |
An optional curve to follow when travelling to the next joint. |
height |
number |
<optional> |
An optional extrusion height of any shell facets generated by this junction. |
projection |
number |
<optional> |
An optional additional offset added to the outer edge of the element. |
outerEdgeOffset |
number |
<optional> |
An optional displacement distance of the outside face from the path, defaults to construction. |
innerEdgeOffset |
number |
<optional> |
An optional displacement distance of the inside face from the path, defaults to construction. |
wallConstruction |
BIM.Construction |
<optional> |
An optional wall construction to use for |
apertureList |
Array.<BIM.Aperture> |
<optional> |
An optional list of apertures that belong to this junction. |
flags |
number |
<optional> |
An optional set of bitwise flags describing boolean properties. |
Extends
Classes
Members
-
:PD.ALIGN
alignment
-
The alignment of the junction's inner and outer boundaries relative to its path.
By default, the inner and outer boundaries are aligned on either side of the path line (PD.ALIGN.NONE or PD.ALIGN.CENTER). However, there are some cases where this may not be appropriate. One example is where a wall is hard up against a site boundary or other element yet you want the junction's path to run along it. In this case, you may set the alignment to PD.ALIGN.LEFT or PD.ALIGN.RIGHT, depending on which side the boundary is on.
You can do the same effect by adjusting the
projectionproperty, but this is a persistent setting that simply add the inner and outer edge offsets to one side of the path rather than both sides.Type
-
:number
angle
-
The angle between the incoming and outgoing lines, in degrees.
.prev >-------------------+_ this ' \_ ' \_ ' angle \_ ' \_ . . \_ ' . _ . ' .nextThis requires both
prevandnextconnections, otherwise it will always be 180 (assuming it to be part of straight line). It stores the internal angle where zero means a U-turn, (+/-)90 is a right-angle joint and (+/-)180.0 means the path continues straight.Type
- number
- Inherited From:
- Overrides:
-
:Array.<BIM.Aperture>
apertureList
-
Stores any apertures that belong to this junction.
Type
- Array.<BIM.Aperture>
-
:Map
attributes
-
A map to store additional properties for the point.
You are encouraged to use the
getAttribute(),setAttribute()anddeleteAttribute()methods when working with attributes as this will future-proof your code against any changes in how point attributes are stores.In addition, this class provides a number of getter/setter accessors for frequently used attributes, which means that you can use them as you would normal properties. These point attributes include:
NAME TYPE DESCRIPTION selected boolean Whether or not the point is selected by the user. junction BIM.Junction The parent junction that generated this point. curveId number An integer indicating that point is part of a curve. normal THREE.Vector3 The surface normal direction. tangent THREE.Vector3 The average between incoming and outgoing vectors. binormal THREE.Vector3 The cross-product of the normal and tangent. uv THREE.Vector2 The texture coordinate at the point. color THREE.Color The vertex color at the point. refPos THREE.Vector3 A copy of the point's position at some previous time. Type
- Map
- Inherited From:
- Overrides:
-
:THREE.Vector3|null
binormal
-
Stores a tangent direction at the given point.
Tangents on points are mainly used when generating and displaying curved polylines and surfaces.
As not all model points require a binormal direction, this is actually a getter/setter for a vector object that is dynamically created as an attribute when first set. To remove this attribute from the attribute list, set its value to
null.Type
- THREE.Vector3 | null
- Inherited From:
- Overrides:
-
:string
className <readonly>
-
The name of the BIM class for this object instance.
This name must match the name of this class within the
PD.Registry. Thus, the base implementation simply referencesthis.constructor.getClassName()to ensure that this is always the case even for subclasses. As a result, there is rarely any need to override this.This property is used when copying, storing and exporting data for BIM object instances to ensure that they are recreated as instances of the right class.
Type
- string
-
:THREE.Color|null
color
-
Stores a color value for the given point.
Color values on points are mainly used for rendering.
As not all points require a color value, this is actually a getter/setter for a color value that is dynamically created as an attribute when first set. To remove this attribute from the attribute list, set its value to
null.Type
- THREE.Color | null
- Inherited From:
- Overrides:
-
:number
cornerInset
-
The calculated inset of the internal face along the path line.
This is computed from the angles between the previous and next path path points, as well as the
innerEdgeOffset(orouterEdgeOffsetif the path point is concave relative to the host path). It is used as a sideways position limit for windows and doors to ensure that they will actually fit within the depth of their host wall, and by columns, railing posts and stair landings to ensure that the geometry of railings and other types of infill will not overlap at very acute corner angles.__..--'\ __..--''\ __..--''\ \ == depth | : \ < depth | : \ \ | - + - - + | - + - - + - - - + - | : / < depth | : / / ''--..__/ ''--..__/ / == depth : ''--.._/ : : : - + - - - - - - + - : cornerInset :Type
- number
- Inherited From:
- Overrides:
-
:PD.Curve|null
curve
-
The curve to follow when travelling to the next joint, if any.
If no curve is assigned, the path travels in a straight line to the next path point in the path. If a curve is assigned, the path follows the segments defined in the curve's own
path.Type
- PD.Curve | null
- Inherited From:
- Overrides:
-
:number
curveId
-
Stores an integer identifier indicating that the given point is part of a sequence of points defining a curve.
This value is typically set when a path containing a curve is offset to generate a new path. Each point on the same curve is assigned the same positive integer curve ID, which can then be used to determine the starting and ending points of each curve. When this value is set, the associated
PD.Curveinstance can be found using thepoint.junction?.curveproperty.If the value of this property is
0or negative, then the point is not part of a curve.Type
- number
- Inherited From:
- Overrides:
-
:BIM.Element|null
element <readonly>
-
The parent element that contains this junction, if any.
Type
- BIM.Element | null
-
:boolean
hasChanged
-
Whether or not the path point's properties have changed since last update.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
hasCurve <readonly>
-
Whether or not the path segment is curved.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
hasEndPlane
-
Whether or not the path point has a different end plane.
Type
- boolean
- Inherited From:
- Overrides:
-
:number
height
-
The extrusion height of any shell facets generated by this path point.
Type
- number
- Inherited From:
- Overrides:
-
:BIM.Space|null
hostSpace
-
Retrieves the space that a wall junction is entering.
This attribute is used by wall elements that penetrate more than one space within the model.
Type
- BIM.Space | null
-
:THREE.Vector3
inNormal
-
A vector giving the normal direction of the previous line.
NOTE: This is based solely on the incoming path line that joins the reference positions of this and the previous path point, and therefore may not be the same as the actual face normal. However it is very useful for internal processing and displaying highlight lines.
PLAN VIEW this.next ^ | | this.prev >----------------+ |_| this | | inNormalType
- THREE.Vector3
- Inherited From:
- Overrides:
-
:PD.ScaledVector
inVec4
-
A scaled vector from the previous point.
This is calculated as the vector from the previous joint to this one. The
x,yandzcomponents are a normalised direction vector, withscalebeing the absolute distance from the last joint.this.prev this +------->-------+ - - - - - - - - > inVec4 (from) (to)Type
- Inherited From:
- Overrides:
-
:number
innerEdgeOffset
-
Stores the displacement distance of the inside face from the path.
This value is used by elements such as walls, slabs, columns, railings and stairs, all of them elements that follow a
PD.Pathbut whose surfaces are slightly offset from the path. It defines the distance that any inner surfaces will be positioned away from the path in the OPPOSITE DIRECTION of the outgoing segment normal (outNormal). As a result, this value is typically positive if the path is somewhere between the inner and outer edges, as shown below.outNormal ^ : - - - - - - - - - - - - - - - outerEdgeOffset : +--- PATH -------------------> outVec4 - - - - - - - - - - - - - - - innerEdgeOffsetIn the specific cases of walls and columns, this value is automatically set to the inner offset of the
BIM.Constructionassigned to them and cannot be overridden without changing the construction.Type
- number
- Inherited From:
- Overrides:
-
:boolean
isColinear
-
Whether or not the path point is colinear with its previous and next path points.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
isConcave
-
Whether or not the cross-product is inverted compared to others in the path.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
isJunction <readonly>
-
A flag identifying this object as a junction.
Type
- boolean
-
:boolean
isPathPoint <readonly>
-
A flag identifying this object as a path point.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
isPoint <readonly>
-
A flag identifying this object as a 3D point.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
isSmooth
-
Whether or not the path point's curve should maintain a smooth change in direction.
When set to true, any Bezier or NURBS curve at the path point will smoothly transition the path direction using control points that can only move along the tangent between incoming and outgoing vectors. When false, control points can move independently.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
isSymmetric
-
Whether or not the magnitude of smooth control points are reflected equally.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
isVariableWidth
-
Whether material changes are gradual instead of sudden or stepped.
Type
- boolean
- Inherited From:
- Overrides:
-
:boolean
isVirtual
-
Whether the path point was added to its path dynamically rather than manually by the user.
Type
- boolean
- Inherited From:
- Overrides:
-
:BIM.Junction|null
junction
-
Stores the parent junction that generated this point.
This is typically set when shell geometry is generated directly from an element path. It is used when post-processing the geometry to allocate selectable facets to junctions.
As not all model points have a parent junction, this is actually a getter/setter for an attribute value. To remove this attribute from the attribute map, set its value to
null.Type
- BIM.Junction | null
- Inherited From:
- Overrides:
-
:BIM.Junction|null
linkedJunction
-
Retrieves a junction that this junction is linked to, if any.
Type
- BIM.Junction | null
-
:PD.PathPoint|null
next
-
A reference to the next path point in the path that this is connected to.
This value is set and managed by the parent path.
Type
- PD.PathPoint | null
- Inherited From:
- Overrides:
-
:number
orientation
-
Stores an orientation angle around the local Z axis.
As not all path points use orientation, this is a getter/setter for an attribute of the same name. This is typically only used on elements whose
BIM.Element#usesJunctionOrientationmethod returnstrue.Type
- number
- Inherited From:
- Overrides:
-
:THREE.Vector3
outNormal
-
A vector giving the normal direction of the next line.
NOTE: This is based solely on the outgoing path line that joins the reference positions of this and the next path point, and therefore may not be the same as the actual face normal. However it is very useful for internal processing and displaying highlight lines.
PLAN VIEW this.next + | ^ |---------- outNormal |__| | | this.prev >--------+ thisType
- THREE.Vector3
- Inherited From:
- Overrides:
-
:PD.ScaledVector
outVec4
-
A scaled vector to the next point.
This is calculated as the vector from this joint to the next one. The
x,yandzcomponents are a normalised direction vector, withscalebeing the absolute distance to the next joint.PLAN VIEW (to) this.next + ^ | : | : ^ : outVec4 | : | : >-----------------+ this (from)Type
- Inherited From:
- Overrides:
-
:number
outerEdgeOffset
-
Stores the displacement distance of the outside face from the path.
This value is used by elements such as walls, slabs, columns, railings and stairs, all of them elements that follow a
PD.Pathbut whose surfaces are slightly offset from the path. It defines the distance that outer surfaces will be positioned away from the path in the DIRECTION of the outgoing path segment normal (outNormal). As a result, this value is typically positive if the path is somewhere between the inner and outer edges, as shown below.outNormal ^ : - - - - - - - - - - - - - - - outerEdgeOffset : +--- PATH -------------------> outVec4 - - - - - - - - - - - - - - - innerEdgeOffsetIn the specific cases of walls and columns, this value is automatically set to the outer offset of the
BIM.Constructionassigned to them and cannot be overridden without changing the construction.Type
- number
- Inherited From:
- Overrides:
-
:PD.Path|null
path
-
The path that this path point belongs to, if any.
Type
- PD.Path | null
- Inherited From:
- Overrides:
-
:PD.PathPoint|null
prev
-
A reference to the previous path point in the path that this is connected to.
This value is set and managed by the parent path.
Type
- PD.PathPoint | null
- Inherited From:
- Overrides:
-
:number
projection
-
An additional offset added to the edge of an offset profile.
Projections are used to make small adjustments to the profiles of area elements such as slabs, ceilings and roof shapes, as well as to the positions of elements that follow an open path such as fixtures, furniture and appliances. Wall and space elements do not use a path point's projection.
Type
- number
- Inherited From:
- Overrides:
-
:THREE.Vector3|null
refPos
-
Retrieves the point's reference position, if stored.
Reference positions store the original position of a point just prior to an interactive user manipulation, so that transformations can be given as absolute/cumulative values rather than relative to the previous frame.
As not all model points require a reference points, this is actually a getter/setter for a vector object that is dynamically created as an attribute when first set. To remove this attribute from the attribute list, set its value to
null.This same attribute value is used by the
PD.Point#getRefPointandPD.Point#storeRefPointmethods, so it will very likely keep being recreated if you manually remove it.Type
- THREE.Vector3 | null
- Inherited From:
- Overrides:
-
:Array.<BIM.Relation>
relationshipList
-
Stores any relationships that this junction is a party to.
Type
- Array.<BIM.Relation>
-
:boolean
selected
-
Whether or not the point is in the current selection set.
As not all model points require a selection indicator, this is actually a getter/setter for a boolean value that is dynamically created as an attribute when first set. To remove this attribute from the attribute map, set its value to
null.Type
- boolean
- Inherited From:
- Overrides:
-
:PD.Shell
shell
-
A shell for storing facets generated by this junction.
Typically, element facets that form part of the building geometry are added to the element's own shell. Facets generated and stored in the junction's shell are used for interactive selection or as part of a more abstract analysis model.
Type
-
:number
signedAngleInRadians
-
The signed angle between the incoming and outgoing path, in radians.
. - ' - . . ' ' . . . . . . signedAngleInRadians . . . .prev >-------------------+_this . \_ . \_ . \_ . \_. \_ .nextThis requires both
prevandnextconnections, otherwise it will always be PI (assuming it to be part of straight line). It stores the signed angle where zero means a U-turn, (+/-)PI/2 is a right-angle joint and (+/-)PI means the path continues straight.Type
- number
- Inherited From:
- Overrides:
-
:THREE.Vector3|null
tangent
-
Stores a tangent direction at the given point.
Tangents on points are mainly used when generating and displaying curved polylines and surfaces.
As not all model points require a tangent direction, this is actually a getter/setter for a vector object that is dynamically created as an attribute when first set. To remove this attribute from the attribute list, set its value to
null.Type
- THREE.Vector3 | null
- Inherited From:
- Overrides:
-
:BIM.Component|null
typeComponent <readonly>
-
References the type component assigned to this junction or its parent element.
Type
- BIM.Component | null
-
:THREE.Vector3
upVector
-
A vector calculated as the cross-product of
prevtothistonext.3D VIEW Z ^ : Y : / upVector / ^ | this.next | + | / | / | / |/ this.prev >--------+ - - - > Y thisType
- THREE.Vector3
- Inherited From:
- Overrides:
-
:boolean
useFillet
-
Whether or not to truncate acute angles using a fillet instead of a mitre.
Type
- boolean
- Inherited From:
- Overrides:
-
:THREE.Vector3|null
uv
-
Stores a UV texture coordinate at the given point.
UV coordinates are 2D vectors that are typically used to store texture mapping information for each vertex of a surface.
As not all model points require a UV coordinates direction, this is actually a getter/setter for a 2D vector object that is dynamically created as an attribute when first set. To remove this attribute from the attribute map, set its value to
null.Type
- THREE.Vector3 | null
- Inherited From:
- Overrides:
-
:Array|null
virtualJunctions
-
Retrieves an array of virtual junctions, if it has one.
As not all junctions need to store virtual junctions, this is actually a getter/setter for an array that is stored as an attribute when first set. To remove this attribute from the attribute map, set its value to
nullor any non-array value.Type
- Array | null
-
:BIM.Construction|null
wallConstruction
-
A wall construction to use for
BIM.SpaceorBIM.Walljunctions.If no wall construction is assigned (value == null), the construction assigned to the element that owns the path is used as the default.
Type
- BIM.Construction | null
-
:object
icon <static>
-
The icon associated with this class in the
PD.Registry.See
PD.Base.iconfor more information on this object format.Type
- object
Methods
-
addAperture(aperture [, index])
-
Add an aperture to this junction.
Parameters:
Name Type Argument Description apertureBIM.Aperture The aperture to add.
indexnumber <optional>
An optional ordinal index at which to insert it.
Returns:
Returns true if aperture was added, otherwise false.
- Type
- boolean
-
addAperturesToExtrudedPolygon(polygon)
-
Inserts any apertures into the given polygon.
This assumes that the polygon was extruded from an inner/outer path, being a quad with four vertices: the first pair at the bottom running in the direction of travel and the second pair at the top running backwards; and is reasonably parallel to the junction path.
If so and inserts either internal or external holes to accommodate the apertures.
Parameters:
Name Type Description polygonPD.Polygon The polygon to insert the aperture in.
Returns:
Returns this junction to support method chaining.
- Type
- BIM.Junction
-
addOrReplaceRelationship(relationship [, junction] [, element])
-
Replaces the first relationship that matches the given type and host junction, or adds it if no match found.
Parameters:
Name Type Argument Description relationshipBIM.Relation The new relationship instance to add or replace existing.
junctionBIM.Junction <optional>
An optional
hostJunctionto match in the relationship, defaults torelationship.hostJunction.elementBIM.Element <optional>
An optional
hostElementto match in the relationship, defaults torelationship.hostElement.Returns:
Returns this junction to support method chaining.
- Type
- BIM.Junction
-
addRelationship(relationship)
-
Adds or updates the relationship list with an instance of a relationship type.
Parameters:
Name Type Description relationshipBIM.Relation An instance of a relationship type.
Returns:
Returns this junction to support method chaining.
- Type
- BIM.Junction
-
alignCursor(cursor)
-
Rotates the cursor to align with this junction.
NOTE: This method sets the three cursor axis as well its quaternion and drag plane.
Parameters:
Name Type Description cursorPD.Cursor The cursor to align.
Returns:
Returns this junction to support method chaining.
- Type
- BIM.Junction
-
arePathAndPlaneAlignedInZ()
-
Retrieves whether or not the path point's path
plane normaland thepath normalboth point upwards or both point downwards in the Z-axis. If the path point does not yet belong to a path, it returns true.- Inherited From:
- Overrides:
Returns:
Returns true if both normals face up or down in z-axis.
- Type
- boolean
-
clearAdjacentApertures()
-
Resets the array of adjacent apertures in an adjacent space to zero length, if it exists.
Use the
getAdjacentApertures()method to retrieve this array after clearing it.Returns:
Returns an array of adjacent apertures, if any.
- Type
- Array
-
clearApertures()
-
Removes all the apertures from this level.
Returns:
Returns this junction to support method chaining.
- Type
- BIM.Junction
-
computeOffsetProfilePoints(shell, contour, prevOffset, nextOffset [, offsetUp])
-
Generates a profile around the path point with the given offsets, creating new vertices in the given shell and adding them the
contourarray.This method generates a ray that runs parallel to the incoming vector (
inVec4) but displaced by the givenprevOffsetvalue in the incoming normal direction (inNormal).It then creates a plane whose surface normal is the same as the outgoing normal (
outNormal) and displaced in that direction by the givennextOffsetvalue.The resulting intersection point is the projected position, as shown in the following illustration. If the angle at the path point is less than the current
mitre angle, then a chamfered profile will be generated containing two points. Otherwise the profile will contain a single point.up ^ Ray _| _/ / <- plane -> | |_/ - : - - - - - - - - - - - - - - - - - -(x)- - + - - next this / : nextOffset +---------------------+ - - - - - - - + - - _/ / : angle _/ - _/ / _/ - prev + / : : - +- - - - + - : : prevOffsetNOTE: This method is designed to be as fast as possible as it is used a lot by walls and spaces in the model. As a result, it is highly optimised for the most common use cases where the path point itself sits between the inside and outside profiles. As this method only knows about one side at a time (it is called twice with different offsets to get both sides), it cannot easily predict the best position for a mitering plane when the angle is less that the current
mitre angle, so uses the path point itself as the reference point. This works fine when the path point is within both profiles or just outside them, but not when large offsets put it well outside them.If you must use large offsets, consider generating an offset path first using the
PD.Path#generateOffsetPathmethod and then generating geometry from that path instead. There is also aBIM.ATTRIB.OFFSET_PATHattribute you can use to store such paths in your element.Parameters:
Name Type Argument Default Description shellPD.Shell The shell to reuse points from.
contourArray The array to add offset points to.
prevOffsetnumber The offset distance normal to the incoming line segment.
nextOffsetnumber The offset distance normal to the outgoing line segment.
offsetUpnumber <optional>
0 The offset distance in the direction of the path point UP vector in mm, defaults to 0.
- Inherited From:
- Overrides:
Returns:
Returns an array of one or more projected positions.
- Type
- Array
-
computeOffsetProfilePointsByCallback(prevOffset, nextOffset, offsetUp, callback [, ignoreCurve])
-
Computes points on a line offset from this path point.
This method generates a ray that runs parallel to the incoming vector (
inVec4) but displaced by the givenprevOffsetvalue in the incoming normal direction (inNormal).It then creates a plane whose surface normal is the same as the outgoing normal (
outNormal) and displaced in that direction by the givennextOffsetvalue.The resulting intersection point is the projected position, as shown in the following illustration. If the angle at the path point is less than the current
mitre angle, then a chamfered profile will be generated containing two points. Otherwise the profile will contain a single point.up ^ Ray _| _/ / <- plane -> | |_/ - : - - - - - - - - - - - - - - - - - -(x)- - + - - next this / : nextOffset +---------------------+ - - - - - - - + - - _/ / : angle _/ - _/ / _/ - prev + / : : - +- - - - + - : : prevOffsetNOTE 1: This method is designed to be as fast as possible as it is used a lot by walls and spaces in the model. As a result, it is highly optimised for the most common use cases where the path point itself sits between the inside and outside profiles. As this method only knows about one side at a time (it is called twice with different offsets to get both sides), it cannot easily predict the best position for a mitering plane when the angle is less that the current
mitre angle, so uses the path point itself as the reference point. This works fine when the path point is within both profiles or just outside, but not when large offsets put it well outside them.If you must use large offsets, consider generating an offset path first using the
PD.Path#generateOffsetPathmethod and then generating geometry from that path instead. There is also aBIM.ATTRIB.OFFSET_PATHattribute you can use to store such paths in your element.NOTE 2: The callback function is invoked for each point in the offset profile with a
THREE.Vector3position as the first argument and a numeric curve identifier as the second. The position argument object is a static shared object with its x, y and z position updated prior to each call. Thus, if you want to persist each position in the callback, you will need to create a new point or vertex object and copy the x, y, and z values tp it, as shown in the example below.Parameters:
Name Type Argument Default Description prevOffsetnumber The offset distance normal to the incoming line segment in mm.
nextOffsetnumber The offset distance normal to the outgoing line segment in mm.
offsetUpnumber The offset distance in the direction of the path point UP vector in mm.
callbackfunction A callback invoked each time an offset point is added.
ignoreCurveboolean <optional>
false A flag to not include curve points when creating columns, posts or platforms, defaults to false.
- Inherited From:
- Overrides:
Example
const contour = []; const shell = new PD.Shell(); const path = getPathToCreateOuterEdgeProfileFor(); for (const point of path.getContour(0)) { point.computeOffsetProfilePointsByCallback( (point.prev) ? point.prev.outerEdgeOffset : point.outerEdgeOffset, point.outerEdgeOffset, 0.0, (pt) => { const vtx = shell.addVertex(pt); // Copy position to shell. vtx.junction = point; // Store point that created it. contour.push(vtx); } } ); -
computeProjectedPosition(result [, offset])
-
Computes the bounded path point position after projection and offset.
This method generates a ray that runs parallel to the incoming vector (
inVec4) but displaced by the given offset and the previous path point'sprojectionvalue in the incoming normal direction (inNormal).It then creates a plane whose surface normal is the same as the outgoing normal (
outNormal) and displaced in that direction by the given offset and the current path point'sprojectionvalue.The resulting intersection point is the projected position, as shown in the following illustration. However, This method places a limit on the distance of the intersection point to prevent it from extending beyond the sizes of the incoming and outgoing vectors at very acute angles.
up ^ Ray _| _/ / <- plane -> | |_/ - : - - - - - - - - - - - - - - - - - -(x)- - + - - next this / : this.projection + offset +---------------------+ - - - - - - - + - - _/ / : angle _/ - _/ / _/ - prev + / : : - +- - - - + - : : prev.projection + offsetParameters:
Name Type Argument Description resultTHREE.Vector3 A point vector to receive the projected position.
offsetnumber <optional>
An optional additional path offset value, defaults to zero.
- Inherited From:
- Overrides:
Returns:
Returns the
resultargument with the new position.- Type
- THREE.Vector3
-
computeProjectedPositionUnBounded(result, prevOffset, nextOffset)
-
Computes the unbounded position relative to the path point with the given previous and next offset values.
Unbounded means that the distance of the computed position is not limited by the current
mitre angle, so at acute angles and/or relatively large offsets, it can extend well beyond the path point. Thus, only use this method instead of thecomputeProjectedPosition()method when you need the position accurately computed, but have some other means of limiting geometry based on that position.This method generates a ray that runs parallel to the incoming vector (
inVec4) but displaced by the givenprevOffsetin the incoming normal direction (inNormal). It then creates a plane whose surface normal is the same as the outgoing normal (outNormal) and displaced in that direction by thenextOffset.The resulting intersection point is the projected position, as shown in the following illustration.
up ^ Ray _| _/ / <- plane -> | |_/ - : - - - - - - - - - - - - - - - - - -(x)- - + - - next this / : nextOffset +---------------------+ - - - - - - - + - - _/ / : _/ - _/ / _/ - prev + / : : - +- - - - + - : : prevOffsetParameters:
Name Type Description resultTHREE.Vector3 A point vector to receive the projected position.
prevOffsetnumber The offset distance normal to the incoming line segment in mm.
nextOffsetnumber The offset distance normal to the outgoing line segment in mm.
- Inherited From:
- Overrides:
Returns:
Returns the
resultargument with the new position.- Type
- THREE.Vector3
-
computeProjectionOffset()
-
Checks for adjacent relationships and adds the appropriate offset.
This is primarily used by furniture, fixtures and shades that are adjacent to walls or other surfaces and need to be offset by their thickness. It simply adds any relationship offsets to the path point's own
projectionvalue.- Inherited From:
- Overrides:
Returns:
Returns the computed projection.
- Type
- number
-
computeProperties(path)
-
Computes core properties required for this junction when it sits in a path.
This method essentially calculates and updates all the path properties stored by the junction.
Parameters:
Name Type Description pathBIM.Path The path that this junction is part of.
- Inherited From:
- Overrides:
Returns:
Returns this junction to support method chaining.
- Type
- PD.PathPoint
-
computeWallSurfaceOffset()
-
Checks for adjacent relationships and offset the appropriate end.
This is primarily used by furniture and fixtures that are adjacent to walls or other surfaces in a space and need to be offset by their inner/outer construction thickness.
As walls ignore their
projectionproperty, this method differs from theBIM.Junction#computeProjectionOffsetmethod in that it returns only the relationship offset.- Inherited From:
- Overrides:
Returns:
Returns the computed offset.
- Type
- number
-
constrainPointToSegmentPlane(point [, target])
-
Constrains the point to lie between this path point and the next.
Parameters:
Name Type Argument Description pointTHREE.Vector3 The point to constrain inside the path point.
targetTHREE.Vector3 <optional>
An optional point to receive the new position, defaults to
point.- Inherited From:
- Overrides:
Returns:
Returns true if the point was constrained.
- Type
- boolean
-
copyAttribs(pos [, normal] [, flip])
-
Copies the position and normal direction from the given point/vertex.
NOTE: If the
posargument is aPD.Point, its normal will also be automatically copied if it has one. You can provide thenormalargument as well if you wish to override the normal direction.Parameters:
Name Type Argument Default Description posTHREE.Vector3 The 3D position to set this point to.
normalTHREE.Vector3 <optional>
The unit normal at the point position.
flipboolean <optional>
false Whether or not to store a negated normal, defaults to false.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
copyPathProperties(pathPoint)
-
Copies path properties from the given path point to this one.
This includes vectors, normals, angles, flags and some attributes. This is useful when you want to duplicate a path point's properties without creating a new instance, for example when updating a path point with new values from another path point.
Parameters:
Name Type Description pathPointPD.PathPoint The path point to copy properties from.
- Inherited From:
- Overrides:
Returns:
Returns this path point to support method chaining.
- Type
- PD.PathPoint
-
copyPoint(data)
-
Copies point data from an array, vector or another point.
Parameters:
Name Type Description dataArray | object The array/object to copy from.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
deleteAttribute(name)
-
Removes an arbitrary attribute from this point, if it exists.
Parameters:
Name Type Description namestring The name of the attribute to remove.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
dimension(mesh, size)
-
Adds dimension lines for the given junction.
Parameters:
Name Type Description meshPD.PolyMesh The mesh to render to.
sizenumber The size of dimension in model units.
Returns:
Returns true if anything was added to the mesh.
- Type
- boolean
-
dimensionSegment(mesh, size)
-
Adds dimension lines for the previous, current and next path segments.
Parameters:
Name Type Description meshPD.PolyMesh The mesh to render to.
sizenumber The size of dimension in model units.
Returns:
Returns true if anything was added to the mesh.
- Type
- boolean
-
distancePointToSegment(point [, target])
-
Computes the distance from a point to the line segment between this and its next path point.
As this is typically used for snapping, it will only return a valid value if the closest point on the line segment is between this and the next path point. Otherwise it will return
Infinity, even if there is just a single path point in the path as it has no corresponding segment.If a
targetvector is given, this will be set to the closest point on the path segment if the return value is less than Infinity.Parameters:
Name Type Argument Description pointTHREE.Vector3 The point to test for distance.
targetTHREE.Vector3 <optional>
An optional point to receive the closest point on the segment.
- Inherited From:
- Overrides:
Returns:
Returns the distance to the line segment.
- Type
- number
-
distancePointToSegmentPlane(point)
-
Computes the distance between the given point and the path point face.
This uses the plane equation of the segment between this path point and its next to compute the distance of the point away.
Parameters:
Name Type Description pointTHREE.Vector3 The point to
- Inherited From:
- Overrides:
Returns:
Returns the distance to the given plane
- Type
- number
-
extendToPlane(plane [, target] [, reverse] [, min])
-
Projects the path point's outgoing direction vector to intersect the given plane.
If the
reverseargument is set to true orPD.REVERSE, the point will be extended in the direction of its incoming vector. If false orPD.FORWARD, (the default value) the outgoing vector (PD.REVERSE) will be used.If the plane is behind the point, parallel to the direction vector, or no intersection was found, the
targetwill not be modified and the method will return false.Parameters:
Name Type Argument Default Description planeTHREE.Plane The plane to intersect with.
targetTHREE.Vector3 <optional>
An optional vector to receive the intersection point, defaults to this point.
reverseboolean <optional>
false Whether or not to reverse the direction to extend, either
PD.FORWARDorPD.REVERSE, defaults to false.minnumber <optional>
An optional minimum distance in the given direction from the path point to consider a valid intersection, defaults to -Infinity.
- Inherited From:
- Overrides:
Returns:
Returns true if there was a valid intersection point and
targetwas successfully set, otherwise false.- Type
- boolean
-
extrudePathLineFacet(vector, distance)
-
Generates a single extruded facet along the path line in the shell of this junction.
This method uses
extrudeSelectionFacet()to generate the new facet.NOTE: This method reuses vertices already in the given shell, so must only be used between calls to its
reuseStart()andreuseEnd()methods.Parameters:
Name Type Description vectorTHREE.Vector The normalised vector direction of the extrusion.
distancenumber The distance to extrude in the vector direction.
Returns:
Returns the new facet, or null if junction is at the end of a path.
- Type
- PD.Polygon | null
-
extrudeSelectionFacet(pnt1, pnt2, vector, distance [, shell])
-
Generates a single extruded facet between the two points in the shell of this junction.
NOTE: This method reuses vertices already in the given shell, so must only be used between calls to its
reuseStart()andreuseEnd()methods.Parameters:
Name Type Argument Description pnt1THREE.Vector The first point on the extrusion line.
pnt2THREE.Vector The second point on the extrusion line.
vectorTHREE.Vector The normalised vector direction of the extrusion.
distancenumber The distance to extrude in the vector direction.
shellPD.Shell <optional>
An optional shell to generate the face in, defaults to
this.shell.Returns:
Returns the new facet, or null if junction is at the end of a path.
- Type
- PD.Polygon | null
-
extrudeSelectionFacetToPlane(pnt1, pnt2, vector, plane [, shell])
-
Generates a single extruded facet between the two points in the shell of this junction.
NOTE: This method reuses vertices already in the given shell, so must only be used between calls to its
reuseStart()andreuseEnd()methods.Parameters:
Name Type Argument Description pnt1THREE.Vector The first point on the extrusion line.
pnt2THREE.Vector The second point on the extrusion line.
vectorTHREE.Vector The normalised vector direction of the extrusion.
planeTHREE.Plane The distance to extrude in the vector direction.
shellPD.Shell <optional>
An optional shell to generate the face in, defaults to
this.shell.Returns:
Returns the new facet, or null if junction is at the end of a path.
- Type
- PD.Polygon | null
-
findFacetsOfType(type)
-
Searches the junction's shell for facets of the given type.
Parameters:
Name Type Description typePD.FACET The type of facet to find.
Returns:
Returns an array of facets of the given type.
- Type
- Array
-
findNewAperturePosition()
-
Attempts to compute an optimum center position and size for a new aperture.
This method returns an array with the optimal horizontal and vertical offsets of the centre position from the host junction. It also includes the maximum width and height dimensions as the second pair of values.
Returns:
Returns a [u,v,w,h] array with UV coordinates relative to the host junction.
- Type
- Array
-
findPathContourAndIndex()
-
Determines which contour the path point belongs to and its ordinal index within that contour.
This method iterates through the contours of the path, and checks if they contain the path point. If found, it returns an array with the contour as the first item and the index of the path point within that contour as the second item.
- Inherited From:
- Overrides:
Returns:
Returns a [contour,index] array.
- Type
- Array
-
findRelationships( [junction] [, element])
-
Searches for any relationships with the given host junction.
Parameters:
Name Type Argument Description junctionBIM.Junction <optional>
An optional
hostJunctionto match in the relationship.elementBIM.Junction <optional>
An optional
hostElementto match in the relationship.Returns:
Returns an array of zero or more matching relationships.
- Type
- Array.<BIM.Relation>
-
findRelationshipsByType(type [, junction] [, element])
-
Searches the relationship map for an instance of the given relationship type.
Parameters:
Name Type Argument Description typeBIM.Relation A relationship type constructor to check for.
junctionBIM.Junction <optional>
An optional
hostJunctionto match in the relationship.elementBIM.Element <optional>
An optional
hostElementto match in the relationship.Returns:
Returns an array of zero or more matching relationships.
- Type
- Array.<BIM.Relation>
-
fromJSON(data)
-
Safely copy properties from a source object.
See the
PD.Base#fromJSONmethod for more details.Parameters:
Name Type Description dataobject The source object containing data to copy.
- Inherited From:
- Overrides:
Returns:
Returns this instance to support method chaining.
- Type
- BIM.Component
Example
// Overriding this method. class MyPoint extends PD.Point { /// ... fromJSON(data) { super.fromJSON(data); if ('extraData' in data) { this.extraData = PD.Utils.toIntegerInRange(data.extraData, this.extraData, 0, 16); } if ('evenMoreData' in data) { this.evenMoreData = PD.Utils.toNumber(data.evenMoreData, this.evenMoreData); } return this; }; /// ... }; -
generateCornerProfileByCallback(coords, width, offset, callback [, options])
-
Generates a corner profile used for columns, railing posts and stair landings.
This method requires that the
innerEdgeOffsetandouterEdgeOffsetproperties of the path point have already been set appropriately for the profile. This requirement allows elements and/or components greater control over the relative alignment of the profile and the ability to offer more detailed options than could be provided internally through a simple alignment argument.The overall depth of the profile will be equal to
outerEdgeOffset + innerEdgeOffset. If these properties have not been set, or the resulting profile depth is zero, a default depth of 900mm (3') will be used.When the
options.maintainDepthargument is greater than 1, the method will make all reasonable attempts to ensure that the two edges that point towards the previous and next path points are equal to the depth of the profile, even when the angle at the path point is quite acute. It does this by either displacing the sides or extending out the profile width to to maintain the depth, as shown in the illustration below.maintainDepth: maintainDepth: 0 2 prev prev __..--'\ __..--'' __..--''\ __..--'' __..--'' __\--' | : __.\'' < depth | : __..--'' \ == depth | - +'- - + | - +'- - > > > > + | :'--./__ < depth | :'--..__ / == depth ''--..__/ ''--..__ ''--..__ ''--/.__ next ''--.._/ ''--..__ nextWhen generating the profile, this method also computes connection data for the incoming and outgoing edges of the profile, creating or updating a
PD.ConnectionDataobject as an attribute of the path point with thePD.ATTRIB.CONNECT_DATAkey. This basically stores the four points that define the incoming and outgoing edges of the profile, being the corner points marked as0and1in the illustration below. The first point (0) in each edge is on the inner side based on the direction of travel along the path, and the second point (1) is on the outer side.^ Y : : Outer Outer 1----------1 - - > - - 1-------+._ - - - - -> X | | | ''-.1 _ incoming outgoing - > - incoming / ' - _ | from | | to outgoing ' - _ 0----------0 - - > - - 0-----+._ / ' - _ Inner Inner ''0 _ ' ' - _Parameters:
Name Type Argument Description coordsPD.LocalCoordinates The local coordinate system to use.
widthnumber The size of the corner profile in the path direction.
offsetnumber The offset of the corner profile normal to the path.
callbackfunction A callback invoked each time a profile point is added.
optionsobject <optional>
An optional configuration object containing flags to control corner generation.
Properties of
options:Name Type Argument Description maintainDepthnumber <optional>
How to maintain edge depth of acutely angled profiles (0 to 2), defaults to 0.
noCurveOffsetboolean <optional>
Whether to not add a half the width at the start of a curved path, defaults to false.
noStartOffsetboolean <optional>
Whether to not add a half the width at the start of an open path, defaults to false.
noEndOffsetboolean <optional>
Whether to not add a half the width at the end of an open path, defaults to false.
- Inherited From:
- Overrides:
Returns:
Returns edge connection data for the profile.
- Type
- PD.ConnectionData
-
generateInnerEdge(shell [, swapSides] [, addProjection] [, ignoreCurve])
-
Generates the inside edge of the path point.
This method computes the inner edge points for this path point. It reuses vertices from the given shell so that facets can be extruded that reference the same points.
The inner edge is usually offset by the
innerEdgeOffsetproperty of the path point. However, if theswapargument is set to true, then theouterEdgeOffsetproperty will be used to swap the inner/outer aspect of the wall element.Parameters:
Name Type Argument Default Description shellPD.Shell The shell to reuse vertices from.
swapSidesboolean <optional>
false A flag to use the outer offset rather than inner, defaults to false.
addProjectionboolean <optional>
false A flag to include the path point's
projectionoffset as well, defaults to false.ignoreCurveboolean <optional>
false A flag to not include curve points when creating columns, posts or platforms, defaults to false.
- Inherited From:
- Overrides:
Returns:
Returns an array of one or more projected positions.
- Type
- Array
-
generateInnerFacets(parentShell, path, extrusion [, flipNormals])
-
Builds and stores the inner facets that belong to this junction.
This method does two things...
Firstly it generates vertically extruded facets that run along the path of the junction that are added to the junction's own
shellproperty. These are not typically shown as part of building geometry, but are used for interactive selection and highlighting the junction.Secondly, if a valid
parent_shellis given, it also generates and adds internal wall surfaces to the parent shell. These follow the inner edge previously calculated by a call to the junction'sgenerateInnerEdge()method, and are used space and wall elements to as their inner boundary surfaces.NOTE: This method reuses vertices already in the given parent shell, so must only be called between calls to that shell's own
reuseStart()andreuseEnd()methods. The junction's own shell is managed internally, so you do not have to do or call anything on that shell - only the given parent shell.Parameters:
Name Type Argument Default Description parentShellPD.Shell | null The shell to add inner facets to.
pathBIM.Path The element path to extrude.
extrusionTHREE.Plane | number Either a plane to extrude to or a height in the Z axis.
flipNormalsboolean <optional>
false Whether or not to flip surface normal direction, defaults to false.
Returns:
Returns this junction to support method chaining.
- Type
- PD.PathPoint
-
generateOuterEdge(shell [, swapSides] [, addProjection] [, ignoreCurve])
-
Generates the outside edge of the path point.
This method computes the outer edge points for this path point. It reuses vertices from the given shell so that facets can be extruded that reference the same points.
The outer edge is usually offset by the
outerEdgeOffsetproperty of the path point. However, if theswapargument is set to true, then theinnerEdgeOffsetproperty will be used to swap the inner/outer aspect of the wall element.Parameters:
Name Type Argument Default Description shellPD.Shell The shell to reuse vertices from.
swapSidesboolean <optional>
false A flag to use the inner offset rather than outer, defaults to false.
addProjectionboolean <optional>
false A flag to include the
projectionoffset as well, defaults to false.ignoreCurveboolean <optional>
false A flag to not include curve points when creating columns, posts or platforms, defaults to false.
- Inherited From:
- Overrides:
Returns:
Returns true if one or more vertices were added to the outer edge array.
- Type
- boolean
-
generateOuterFacets(parentShell, path, extrusion [, flipNormals])
-
Builds and stores the outer facets that belong to this junction.
This method adds facets based on the outer edge previously calculated by a call to the
generateOuterEdge()method. This method is used by wall elements to generate their boundary surfaces.NOTE: This method reuses vertices already in the given shell, so must only be used between calls to its
reuseStart()andreuseEnd()method. Even though the facets are generated using the given shell, the junction stores a copy of each facet within its ownshellto that it can highlight them when interactively selected.Parameters:
Name Type Argument Default Description parentShellPD.Shell The shell to add facets to.
pathBIM.Path The element path to extrude.
extrusionTHREE.Plane | number Either a plane to extrude to or a height in the Z axis.
flipNormalsboolean <optional>
false A flag to flip the surface normal direction, defaults to false.
Returns:
Returns this junction to support method chaining.
- Type
- PD.PathPoint
-
getAdjacentApertures()
-
An array of adjacent apertures in an adjacent space.
This array is stored internally as an attribute as only space and wall junctions can host apertures and therefore need to cache this information.
Returns:
Returns an array of adjacent apertures, if any.
- Type
- Array
-
getAngle()
-
Checks if the path point is curved and returns either the angle of the first curve segment or, if not curved, the standard path point angle.
- Inherited From:
- Overrides:
Returns:
Returns either the curved or linear angle in degrees.
- Type
- number
-
getAttribute(name)
-
Retrieve an arbitrary attribute stored on this point, if it exists.
Parameters:
Name Type Description namestring The name of the attribute to retrieve.
- Inherited From:
- Overrides:
Returns:
Returns the attribute value, or undefined if it does not exist.
- Type
- any | undefined
-
getIncomingNormal()
-
Checks if the previous path point is curved and returns either the incoming normal of the last curve segment or, if not curved, the standard path point incoming normal.
- Inherited From:
- Overrides:
Returns:
Returns either the curved or linear ingoing normal.
- Type
- THREE.Vector3
-
getIncomingVector()
-
Checks if the previous path point is curved and returns either the incoming vector of the last curve segment or, if not curved, the standard path point incoming vector.
- Inherited From:
- Overrides:
Returns:
Returns either the curved or linear incoming vector.
- Type
- PD.ScaledVector
-
getInnerEdge( [create])
-
An array for inner boundary points calculated relative to the path.
For polygonal spaces and closed loop wall elements, there are definite interior and exterior sides. This array stores the inside.
Edges are stored as an array of
PD.Pointobjects marking the path of travel. They are stored internally as attributes as only space and wall junctions need to cache this information.Parameters:
Name Type Argument Default Description createboolean <optional>
false When true, creates an array if not yet created, defaults to false.
- Inherited From:
- Overrides:
Returns:
Returns an array of inner edge points, if any.
- Type
- Array | null
-
getInnerFacets( [create])
-
An array of internal facets generated when this path point is part of a space.
This is set when the
generateInnerFacets()method is called by the parent space. The facets in this array are links to facets within the parent spacesinnerShell.Parameters:
Name Type Argument Default Description createboolean <optional>
false When true, creates an array if not yet created, defaults to false.
- Inherited From:
- Overrides:
Returns:
Returns an array of inner edge points, if any.
- Type
- Array | null
-
getNormal()
-
Checks if the path point is curved and returns either the normal of the first curve segment or, if not curved, the standard path point normal.
- Inherited From:
- Overrides:
Returns:
Returns either the curved or linear normal.
- Type
- THREE.Vector3
-
getOuterEdge( [create])
-
An array for outer boundary points calculated relative to the path.
For simple slab elements, the boundary is assumed to be the external edge that runs along the right-hand side of the polygon/polyline path, based on the right-hand rule and the +Z axis. It is determined by the current position and projection values, as well aa shared element properties.
Edges are stored as an array of
PD.Pointobjects marking the path of travel. They are stored internally as attributes as only space and wall junctions need to cache this information.Parameters:
Name Type Argument Default Description createboolean <optional>
false When true, creates an array if not yet created, defaults to false.
- Inherited From:
- Overrides:
Returns:
Returns an array of outer edge points, if any.
- Type
- Array | null
-
getOutgoingNormal()
-
Checks if the path point is curved and returns either the outgoing normal of the first curve segment or, if not curved, the standard path point outgoing normal.
- Inherited From:
- Overrides:
Returns:
Returns either the curved or linear outgoing normal.
- Type
- THREE.Vector3
-
getOutgoingVector()
-
Checks if the path point is curved and returns either the outgoing vector of the first curve segment or, if not curved, the standard path point outgoing vector.
- Inherited From:
- Overrides:
Returns:
Returns either the curved or linear outgoing vector.
- Type
- PD.ScaledVector
-
getPathUpVector()
-
Retrieves the path point's
path normalif it belongs to a path, otherwise its ownupVectorproperty.- Inherited From:
- Overrides:
Returns:
Returns the 'up' vector for this path point.
- Type
- THREE.Vector3
-
getRefPoint()
-
Retrieves the point's reference position.
Reference positions allow a point to be interactively manipulated even if it is referenced multiple times within the same selection set. This is done by always moving or transforming point relative to its original reference position.
As not all model points require a reference position, this is actually a getter for a vector object that is dynamically created as an attribute when first accessed.
- Inherited From:
- Overrides:
Returns:
Returns the reference point.
- Type
- THREE.Vector3
-
getSignedAngleInRadians()
-
Checks if the path point is curved and returns either the signed angle of the first curve segment or, if not curved, the standard signed path point angle in radians.
- Inherited From:
- Overrides:
Returns:
Returns either the curved or linear angle in radians.
- Type
- number
-
hasRelationships()
-
Checks if this junction has one or more relationships.
Returns:
Returns true if this junction has at least one relationship.
- Type
- boolean
-
isPointInsideSegmentPlane(point)
-
Check if the point lies between this path point and the next.
Parameters:
Name Type Description pointTHREE.Vector3 The point to constrain inside the path point.
- Inherited From:
- Overrides:
Returns:
Returns true if the point was constrained.
- Type
- boolean
-
moveByCoordinates(dx, dy, dz)
-
Moves this point relative to its reference position.
This method is typically called by the host application after storing the reference position. The given movement in each axis is the translation value relative to the stored reference position. This allows points to be accurately dragged interactively even if some frames are skipped due to slow updates or the point is referenced multiple times within the selection set that is being manipulated.
Parameters:
Name Type Description dxnumber The relative movement distance in the X-axis.
dynumber The relative movement distance in the Y-axis.
dznumber The relative movement distance in the Z-axis.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
moveByMatrix4(matrix [, about])
-
Applies the given matrix to the point's reference position.
This method is typically called by the host application after storing the reference position. The given transformation matrix is applied to the stored reference position. This allows points to be accurately scaled and rotated interactively even if some frames are skipped due to slow updates or the point is referenced multiple times within the selection set that is being manipulated.
Parameters:
Name Type Argument Description matrixTHREE.Matrix4 The relative transform matrix.
aboutTHREE.Vector3 <optional>
An optional point about which to apply the transform.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
moveByQuaternion(quat [, about])
-
Applies the given quaternion to the point's reference position.
This method is typically called by the host application after storing the reference position. The given quaternion is applied relative to the stored reference position. This allows points to be accurately rotated interactively even if some frames are skipped due to slow updates or the point is referenced multiple times within the selection set that is being manipulated.
Parameters:
Name Type Argument Description quatTHREE.Quaternion The quaternion to apply.
aboutTHREE.Vector3 <optional>
An optional point about which to apply the transform.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
moveByVector3(vector)
-
Moves this point relative to its reference position.
This method is typically called by the host application after storing the reference position. The given movement vector is the translation value relative to the stored reference position. This allows points to be accurately dragged interactively even if some frames are skipped due to slow updates or the point is referenced multiple times within the selection set that is being manipulated.
Parameters:
Name Type Description vectorTHREE.Vector3 The relative movement vector.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
orientLocalCoordinates(coords)
-
Sets the given local coordinates to orient with the path segment of this path point.
Parameters:
Name Type Description coordsPD.LocalCoordinates The local coordinates to orient.
- Inherited From:
- Overrides:
Returns:
Returns the given local coordinates.
- Type
- PD.LocalCoordinates
-
removeAperture(aperture)
-
Removes an aperture from this junction.
Parameters:
Name Type Description apertureBIM.Aperture The aperture to remove.
Returns:
Returns the ordinal index of the removed aperture, or -1 if not found in this junction.
- Type
- number
-
removeRelationship(relationship)
-
Remove a relationship from the list of relationships.
Parameters:
Name Type Description relationshipBIM.Relation The relationship instance to remove.
Returns:
Returns this junction to support method chaining.
- Type
- BIM.Junction
-
removeRelationshipsByType(type [, junction] [, element])
-
Remove a relationship of the given type from the list of relationships.
Parameters:
Name Type Argument Description typeBIM.Relation A relationship type constructor to match.
junctionBIM.Junction <optional>
An optional
hostJunctionto match in the relationship.elementBIM.Element <optional>
An optional
hostElementto match in the relationship.Returns:
Returns this junction to support method chaining.
- Type
- BIM.Junction
-
revertToRefPoint()
-
Resets the point to its reference position.
This method is typically called by the host application after storing the reference position. This allows an interactive drag or transformation to be aborted part-way through whilst accurately returning the point to its original position.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
setAttribute(name, value)
-
Stores an arbitrary attribute on this point, or replaces its value.
Parameters:
Name Type Description namestring The name of the attribute to store.
valuestring The attribute value to store.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
setBinormal(binormal)
-
Sets the binormal direction at this point.
This value is accessible via the
binormalgetter/setter. As not all model points require a binormal direction, this method will dynamically create a new attribute as and when required. To remove this attribute from the attribute map, set its value tonull.This method is can accept any {x,y,z} object or similar, as well as simple [x,y,z] vector arrays.
Parameters:
Name Type Description binormalTHREE.Vector3 | Array.<number> The vector array/object to copy.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
setColor(color)
-
Sets the color value at this point.
This value is accessible via the
colorgetter/setter. As not all model points require a color value, this method will dynamically create a new attribute as and when required. To remove this attribute from the attribute map, set its value tonull.In addition to
THREE.Colorobjects, this method can handle different types of color input value such as hex numbers (0x2b362), CSS strings ('#ffc49c'), simple arrays ([r,g,b]) and any type of{r,g,b}object.Parameters:
Name Type Description colorTHREE.Color | Array.<number> The number/string/array/object defining a color.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
setCurveType(type)
-
Sets the curve type for this path point.
Parameters:
Name Type Description typePD.CURVE The new curve type.
- Inherited From:
- Overrides:
Returns:
Returns true if the type was changed, otherwise false.
- Type
- boolean
-
setPathEndPlane(azi, alt [, extend])
-
Sets the start plane angles for the first path point in a path.
This method is used by classes that extrude shapes along the path and allow the user to set a starting azimuth and altitude angle.
Parameters:
Name Type Argument Description azinumber The azimuth angle relative to the outgoing vector, in radians.
altnumber The altitude angle relative to the outgoing vector, in radians.
extendnumber <optional>
An optional end extension in mm, defaults to 0.
- Inherited From:
- Overrides:
Returns:
Returns this path point to support method chaining.
- Type
- PD.PathPoint
-
setPathStartPlane(azi, alt [, extend])
-
Sets the start plane angles for the first path point in a path.
This method is used by classes that extrude shapes along the path and allow the user to set a starting azimuth and altitude angle.
Parameters:
Name Type Argument Description azinumber The azimuth angle relative to the outgoing vector, in radians.
altnumber The altitude angle relative to the outgoing vector, in radians.
extendnumber <optional>
An optional start extension in mm, defaults to 0.
- Inherited From:
- Overrides:
Returns:
Returns this path point to support method chaining.
- Type
- PD.PathPoint
-
setPos(pos)
-
Sets the position of this point in model space.
This method is can accept any {x,y,z} object or similar, as well as simple [x,y,z] vector arrays.
Parameters:
Name Type Description posTHREE.Vector3 | Array.<number> The vector array/object to copy.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
setTangent(tangent)
-
Sets the tangent direction at this point.
This value is accessible via the
tangentgetter/setter. As not all model points require a tangent direction, this method will dynamically create a new attribute as and when required. To remove this attribute from the attribute map, set its value tonull.This method is can accept any {x,y,z} object or similar, as well as simple [x,y,z] vector arrays.
Parameters:
Name Type Description tangentTHREE.Vector3 | Array.<number> The vector array/object to copy.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
setUV(uv)
-
Sets the UV texture coordinate at this point.
This value is accessible via the
uvgetter/setter. As not all model points require a binormal direction, this method will dynamically create a new attribute as and when required. To remove this attribute from the attribute map, set its value tonull.This method is can accept any {x,y} object or similar, as well as simple [x,y] vector arrays.
Parameters:
Name Type Description uvTHREE.Vector2 | Array.<number> The vector array/object to copy.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
squaredDistanceSegmentToRay(selection)
-
Computes the squared distance between the selection ray and the path segment between this and its next path point.
This method does not actually affect the section set, it just computes the distance using the selection ray. It also uses the selection radius when the path point has a curve to compute the distance to the curve path.
Parameters:
Name Type Description selectionPD.Selection The interactive selection accumulator.
- Inherited From:
- Overrides:
Returns:
Returns the distance to the line segment or curve path.
- Type
- number
-
storeRefPoint()
-
Updates the reference position to the current point position.
This method is typically called automatically by the host application immediately prior to an interactive move or transform event in order to snapshot the current position. This allows the same point object to be accurately moved even if it is referenced multiple times within the selection set that is being manipulated.
- Inherited From:
- Overrides:
Returns:
Returns this point to support method chaining.
- Type
- PD.Point
-
toJSON( [data])
-
Converts the object instance to a simple POJO for JSON storage.
This method is used to copy, store and save the data for ths object, so the returned object must have all the properties required be able to rebuild this instance in its entirety when passed to the class constructor.
See the
PD.Point#toJSONmethod for more details.Parameters:
Name Type Argument Description dataobject <optional>
An optional parent object to append this data to.
- Inherited From:
- Overrides:
Returns:
Returns a JSON object.
- Type
- object
Example
// Overriding this method. class MyPoint extends PD.Point { /// ... toJSON(data) { data = super.toJSON(data); data.extraData = this.extraData; data.evenMoreData = this.evenMoreData; return data; }; /// ... }; -
trimContourToInsideFace(contour)
-
Trims an array of connected points to the inside of the inner plane.
Parameters:
Name Type Description contourArray An array of connected points.
- Inherited From:
- Overrides:
Returns:
Returns the trimmed points array.
- Type
- Array
-
fromVector3(vec) <static>
-
Create a new junction from a given vector.
Parameters:
Name Type Description vecTHREE.Vector3 A generic vector object.
Returns:
Returns a new junction based on the given vector.
- Type
- BIM.Junction
-
getClassDescription() <static>
-
A brief description of this class to accompany its icon.
Returns:
Returns a brief description.
- Type
- string
-
getClassName() <static>
-
The name of this class within the
PD.Registry.See
PD.Base.getClassNamefor more details as this is required for use with thePD.Registry.Returns:
Returns the registered name of this class.
- Type
- string
-
getDisplayName() <static>
-
The name to display within the user interface.
Returns:
Returns the display name.
- Type
- string