Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
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)
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)