Class: ConnectionData

PD. ConnectionData

Stores information about the incoming and outgoing edges of profiles at a path point.

When adding columns, railing posts or stair landings, it is useful to know information about the surfaces that face the previous or next column, post or landing. This allows other elements to span the gaps and line up exactly with the outgoing face of one path point and the incoming face of the next.

This class stores the inside and outside spatial positions of the incoming and outgoing edges of the path point profile.

NOTE: When a path segment is inclined (i.e.: the base of the path points at each end have different positions in the Z-axis), you cannot base the local coordinate system on the point-to-point vectors. The angle of a railing or other infill between profiles should not run from the centre of the first path point to the centre of the second, but rather from the outgoing face of the first path point to the incoming face of the second. This creates a slightly different incline, as shown in the illustration below.

               |   |                     |   |
    +---+      |   |          +---+      |   |
    |   |      1-+-+          |   |      +-1-+
    |   |     /               |   |      _/
    |   |    /                |   |     /
    |   |   /                 |   |   _/
    |   |  /                  |   |  /
    |   | /                   |   |_/
    |   |/                    |  /|
    +-+-0                     +-0-+
    CORRECT ANGLE             WRONG ANGLE
    BETWEEN POST FACES        BETWEEN POST CENTERS

The connector created for each path point profile consists of 4 points ordered in a clockwise direction around the path point when viewed in plan. If infill is to be added between path points 1 and 2, as in the illustration below, then its shape in plan view would join from.outgoingEdge[0], from.outgoingEdge[1], to.incomingEdge[1] and to.incomingEdge[0] to form a facet with a normal facing downwards (as per the right-hand rule), or from.outgoingEdge[0], to.incomingEdge[0], to.incomingEdge[1] and from.outgoingEdge[1], to form a facet with an upwards facing normal.

    ^ Y
    :
    :   Outer                      Outer
    1----------1  -  -  >  -  -  1-------+._ - - - - -> X
    |          |                 |          ''-.1 _
incoming    outgoing -  >  -  incoming         /    ' - _
    |   from   |                 |     to  outgoing       ' - _
    0----------0  -  -  >  -  -  0-----+._   /    ' - _
        Inner                      Inner  ''0 _         '
                                               ' - _

The center line of any infill, or any other alignment variant, can be easily interpolated from the two points defining each face.


new ConnectionData()

Creates a new connection data instance.

Author:
  • drajmarsh

Members


:boolean

hasConnectionData <readonly>

A flag identifying this object as containing face-based connection data.

Type
  • boolean

:Array.<THREE.Vector3, THREE.Vector3>

incomingEdge

An array with the inner and outer points at the base of the incoming edge.

Type
  • Array.<THREE.Vector3, THREE.Vector3>

:boolean

isConnectionData <readonly>

A flag identifying this object as face-based connection data.

Type
  • boolean

:Array.<THREE.THREE.Vector3, THREE.Vector3>

outgoingEdge

An array with the inner and outer points at the base of the outgoing edge.

Type
  • Array.<THREE.THREE.Vector3, THREE.Vector3>

Methods


computeIncomingCenter(result)

Calculates the center point of the incoming face.

Parameters:
Name Type Description
result THREE.Vector3

A 3D vector to receive the computed center point.

Returns:

Returns the given vector.

Type
THREE.Vector3

computeOutgoingCenter(result)

Calculates the center point of the outgoing face.

Parameters:
Name Type Description
result THREE.Vector3

A 3D vector to receive the computed center point.

Returns:

Returns the given vector.

Type
THREE.Vector3

copy(source)

Copies connection data from the given source.

Parameters:
Name Type Description
source PD.ConnectionData

The connection data instance to copy from

Returns:

Returns this connection data to support method chaining.

Type
PD.ConnectionData

copyIncomingFace(source)

Copies just the incoming face connection data from the given source.

Parameters:
Name Type Description
source PD.ConnectionData

The connection data instance to copy from

Returns:

Returns this connection data to support method chaining.

Type
PD.ConnectionData

copyOutgoingFace(source)

Copies just the outgoing face connection data from the given source.

Parameters:
Name Type Description
source PD.ConnectionData

The connection data instance to copy from

Returns:

Returns this connection data to support method chaining.

Type
PD.ConnectionData

sameDirection(outgoingEdge, incomingEdge) <static>

Computes whether or not the vectors defined by the two pairs of points are oriented in the same direction.

Parameters:
Name Type Description
outgoingEdge Array.<THREE.Vector3>

The outgoing face of the from connector.

incomingEdge Array.<THREE.Vector3>

The incoming face of the to connector.

Returns:

Returns true if both connector are oriented in the same direction.

Type
boolean