weldx.CoordinateSystemManager.create_cs_from_axis_vectors#
- CoordinateSystemManager.create_cs_from_axis_vectors(coordinate_system_name, reference_system_name, x=None, y=None, z=None, coordinates=None, time=None, time_ref=None, lcs_child_in_parent=True)#
Create a coordinate system and add it to the
CoordinateSystemManager.This function uses the
LocalCoordinateSystem.from_axis_vectorsmethod of theLocalCoordinateSystemclass.- Parameters:
coordinate_system_name (
str) – Name of the new coordinate system.reference_system_name (
str) – Name of the parent system. This must have been already added.x (
Union[DataArray,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]],Quantity,None]) – A vector representing the coordinate systems x-axisy (
Union[DataArray,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]],Quantity,None]) – A vector representing the coordinate systems y-axisz (
Union[DataArray,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]],Quantity,None]) – A vector representing the coordinate systems z-axiscoordinates (
Union[DataArray,_SupportsArray[dtype[Any]],_NestedSequence[_SupportsArray[dtype[Any]]],bool,int,float,complex,str,bytes,_NestedSequence[Union[bool,int,float,complex,str,bytes]],Quantity,None]) – Coordinates of the origin (Default value = None)time (
Union[DatetimeIndex,datetime64,list[str],Time,TimedeltaIndex,Quantity,timedelta64,Timestamp,str,TimeDependent,None]) – Time data for time dependent coordinate systems (Default value = None)time_ref (
Union[Timestamp,str,Time,None]) – Optional reference timestamp iftimeis a time delta.lcs_child_in_parent (
bool) – If set toTrue, the passedLocalCoordinateSysteminstance describes the new system orientation towards is parent. IfFalse, it describes how the parent system is positioned in its new child system.
Examples
Create a coordinate system from 3 orthogonal vectors:
>>> from weldx import CoordinateSystemManager >>> >>> x = [2, 2, 0] >>> y = [-8, 8, 0] >>> z = [0, 0, 3] >>> >>> csm = CoordinateSystemManager("root") >>> csm.create_cs_from_axis_vectors("xyz", "root", x, y, z)
Create a coordinate system from 2 orthogonal vectors and let the third one be determined automatically:
>>> csm.create_cs_from_axis_vectors("xz", "root", x=x, z=z)