Skip to content

compas_cem.loads ¤

Point loads applied to the nodes of a topology diagram.

Classes¤

NodeLoad ¤

NodeLoad(node, vector=[0.0, 0.0, -1.0], **kwargs)

A point load applied to one node of a diagram.

Parameters:

  • node

    The key of the node to load.

  • vector

    The xyz components of the load. Defaults to one unit downwards.

Source code in src/compas_cem/loads/node.py
def __init__(self, node, vector=[0.0, 0.0, -1.0], **kwargs):
    super(NodeLoad, self).__init__(**kwargs)
    self.node = node
    self.vector = vector
    self.xyz = None

Methods:¤

from_point_and_vector classmethod ¤
from_point_and_vector(point, vector)

Create a load from a point and a vector.

Parameters:

  • point

    The coordinates of the position where the load is applied.

  • vector

    The xyz components of the load.

Returns:

  • load

    A load with no node key, positioned at the given point.

Notes

The load binds to a diagram node whose coordinates match the point. If no node sits there, the load is not assigned.

Source code in src/compas_cem/loads/node.py
@classmethod
def from_point_and_vector(cls, point, vector):
    """
    Create a load from a point and a vector.

    Parameters
    ----------
    point :
        The coordinates of the position where the load is applied.
    vector :
        The xyz components of the load.

    Returns
    -------
    load :
        A load with no node key, positioned at the given point.

    Notes
    -----
    The load binds to a diagram node whose coordinates match the point. If
    no node sits there, the load is not assigned.
    """
    load = cls(node=None, vector=vector)
    load.xyz = point
    return load