Skip to content

node generation

GeneratesNodesMixin

Role mixin for components that generate standalone nodes.

Use this mixin when a component needs to add points or nodes to the model but does not generate a full cell-based mesh. This is useful for advanced interfaces that create helper nodes first and later connect them through constraints or special elements.

Under the hood, the workflow is usually:

  1. derive node locations from existing geometry or assembled state
  2. store the new nodes in component-owned data
  3. register or merge those nodes into the assembled model
Example
class ProbeNodes(GeneratesNodesMixin):
    def build_nodes(self, assembled_mesh, **kwargs):
        self.new_nodes = assembled_mesh.points[:4]

    def integrate_nodes(self, assembled_mesh, **kwargs):
        # Register those points with the owning model or mesh container.
        ...

Methods:

build_nodes

build_nodes(**kwargs) -> None

Construct the component-owned node set.

Subclasses implement this hook when node positions can only be known at runtime, for example after assembly or after inspecting other geometry.

Parameters:

Name Type Description Default
**kwargs

Arbitrary keyword arguments passed from the build context.

{}

Raises:

Type Description
NotImplementedError

If the subclass does not implement this method.

integrate_nodes

integrate_nodes(assembled_mesh, **kwargs) -> None

Register or merge the generated nodes into the assembled model.

Parameters:

Name Type Description Default
assembled_mesh

The global assembled mesh object to which the new nodes will be registered.

required
**kwargs

Arbitrary keyword arguments passed from the integration context.

{}