How to use the splipy.SplineModel.Orientation.compute function in Splipy

To help you get started, we’ve selected a few Splipy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sintefmath / Splipy / splipy / SplineModel.py View on Github external
The return value is another `NodeView` object with a different
        underlying node, but whose orientation corresponds to the original
        view, as expected.
        """
        section = check_section(*args, pardim=self.pardim, **kwargs)
        tgt_dim = sum(1 for s in section if s is None)

        # The index of the section in the reference system
        ref_idx = section_to_index(self.orientation.map_section(section))

        # The underlying node
        node = self.node.lower_nodes[tgt_dim][ref_idx]

        # The underlying lower-order node may not have an orientation that
        # matches the higher-order node, so we need to compose two orientations
        ref_ori = Orientation.compute(node.obj, self.node.obj.section(*section, unwrap_points=False))
        my_ori = self.orientation.view_section(section)

        return NodeView(node, ref_ori * my_ori)
github sintefmath / Splipy / splipy / SplineModel.py View on Github external
def view(self, other_obj=None):
        """Return a `NodeView` object of this node.

        The returned view has an orientation that matches that of the input
        argument. If the argument is omitted, the identity orientation is used.

        :param SplineObject other_obj: The "view" object
        :raises OrientationError: If the object does not match this node's
            underlying object
        """
        if other_obj:
            orientation = Orientation.compute(self.obj, other_obj)
        else:
            orientation = Orientation.compute(self.obj)
        return NodeView(self, orientation)
github sintefmath / Splipy / splipy / SplineModel.py View on Github external
def view(self, other_obj=None):
        """Return a `NodeView` object of this node.

        The returned view has an orientation that matches that of the input
        argument. If the argument is omitted, the identity orientation is used.

        :param SplineObject other_obj: The "view" object
        :raises OrientationError: If the object does not match this node's
            underlying object
        """
        if other_obj:
            orientation = Orientation.compute(self.obj, other_obj)
        else:
            orientation = Orientation.compute(self.obj)
        return NodeView(self, orientation)