========== BezierPath ========== .. py:currentmodule:: p3dsdk .. py:class:: BezierPath Base class: :py:class:`SceneObject` .. py:method:: id :property: The id of the scene object. :type: str, read-only .. py:method:: name :property: The name of the scene object. :type: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: type :property: The type of the scene object. :type: SceneObjectType, read-only .. py:method:: parent_object :property: The parent object of this object or :py:obj:`None` if no parent. :type: SceneObject or None :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If trying to move the object into one of its children, trying to move the object to another model, trying to move the object to itself or trying to move the object to an object which is not a :py:obj:`KinematicNode` (that is an :py:obj:`Axis`, a :py:obj:`Null` or a :py:obj:`Vector` ). .. py:method:: visible :property: The scene object visibility. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: locked :property: The scene object lock state. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: selected :property: Whether the scene object is selected. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: color :property: The shaper color of the scene object. :type: ColorRgb :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: translation :property: The global translation of the scene object, in meters. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: rotation :property: The global rotation of the scene object, in degrees. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: scale :property: The global scale of the scene object. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If trying to set a negative scale or trying to scale a Kinematics object. .. py:method:: pivot_to_world_translation :property: The translation from pivot point to global position, in meters. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: pivot_to_world_rotation :property: The rotation from pivot point to global orientation, in degrees. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: local_to_pivot_translation :property: The translation from local point to pivot position, in meters. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: local_to_pivot_rotation :property: The rotation from local point to pivot orientation, in degrees. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: pivot_to_parent_translation :property: The translation from pivot point to parent position, in meters .. note:: If the object does not have a parent, it returns the global translation. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: pivot_to_parent_rotation :property: The rotation from pivot point to parent orientation, in degrees .. note:: If the object does not have a parent, it returns the global rotation. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: closed :property: If the Bezier path is closed or not. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: invert_evaluation_direction :property: If the evaluation direction is inverted or not. :type: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: evaluation_starting_point :property: The evaluation starting point. This point is on the Bezier path. :type: Vector3 :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: vertex_count :property: The count of vertex contained in the Bezier path. :type: int, read-only .. py:method:: list_child_objects(recursive = True) List the child kinematic object of this objects. :param recursive: If :py:obj:`True`, lists all child objects in this object, otherwise only the direct child objects are returned. :type recursive: bool :returns: The list of kinematic object of this node. :rtype: list(SceneObject) .. py:method:: has_tag(tag) Whether the tag is assigned to the scene object. :param tag: Name of the tag. :type tag: str :returns: Whether the tag is assigned to the scene object. :rtype: bool .. py:method:: list_tags() List all the tags assigned to the scene object. :returns: The list of tags assigned to the scene object. :rtype: list(str) .. py:method:: add_tag(tag) Create a new tag and assign to the scene object. :param tag: Name of the tag. :type tag: str :returns: Whether the tag was added or not. :rtype: bool :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove_tag(tag) Remove tag from the scene object. :param tag: Name of the tag. :type tag: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: remove() Delete this scene object. :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: vertex_from_index(index) Return the vertex guid for the index th vertex. :param index: The index of the vertex in the bezier path. Must be a valid index (0 <= index < vertex count). :type index: int :returns: The vertex guid. :rtype: str :raises ValueError: If the index is invalid. .. py:method:: index_from_vertex(vertex) Return the irdex of the given vertex guid. :param vertex: Is the vertex guid. Must correspond to the guid of a vertex contained into the Bezier path. :type vertex: str :returns: The vertex index in the Bezier path. :rtype: int :raises ValueError: If the guid is not the guid of a vertex contained in the Bezier path. .. py:method:: vertex_position(vertex) Return the world position for the given vertex guid. :param vertex: Is the vertex guid. Must correspond to the guid of a vertex contained into the Bezier path. :type vertex: str :returns: The vertex position in the world coordinates. :rtype: Vector3 :raises ValueError: If the guid is not the guid of a vertex contained in the Bezier path. .. py:method:: vertex_left_tangent_position(vertex) Return the left tangent for the given vertex guid. :param vertex: Is the vertex guid. Must correspond to the guid of a vertex contained into the Bezier path. :type vertex: str :returns: The vertex left tangent expressed in the world coordinates. :rtype: Vector3 :raises ValueError: If the guid is not the guid of a vertex contained in the Bezier path. .. py:method:: vertex_right_tangent_position(vertex) Return the right tangent for the given vertex guid. :param vertex: Is the vertex guid. Must correspond to the guid of a vertex contained into the Bezier path. :type vertex: str :returns: The vertex right tangent expressed in the world coordinates. :rtype: Vector3 :raises ValueError: If the guid is not the guid of a vertex contained in the Bezier path. .. py:method:: set_vertex_position(vertex, position) Set the world position for the given vertex guid. :param vertex: Is the vertex guid. Must correspond to the guid of a vertex contained into the Bezier path. :type vertex: str :param position: The new vertex position in the world coordinates. :type position: Vector3 :raises ValueError: If the guid is not the guid of a vertex contained in the Bezier path. .. py:method:: set_vertex_left_tangent_position(vertex, tangent) Set the left tangent position for the given vertex guid. :param vertex: Is the vertex guid. Must correspond to the guid of a vertex contained into the Bezier path. :type vertex: str :param tangent: The new vertex left tangent position expressed in the world coordinates. :type tangent: Vector3 :raises ValueError: If the guid is not the guid of a vertex contained in the Bezier path. .. py:method:: set_vertex_right_tangent_position(vertex, tangent) Set the right tangent position for the given vertex guid. :param vertex: Is the vertex guid. Must correspond to the guid of a vertex contained into the Bezier path. :type vertex: str :param tangent: The new vertex right tangent position expressed in the world coordinates. :type tangent: Vector3 :raises ValueError: If the guid is not the guid of a vertex contained in the Bezier path. .. py:method:: append_vertex(position, tangent) Append a new vertex to the end of the Bezier path with the given position and tangent. :param position: The position of the new vertex. :type position: Vector3 :param tangent: The tangent of the new vertex. :type tangent: Vector3 :returns: The guid of the new vertex. :rtype: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. .. py:method:: evaluate_position(curvilinear_abscissa) Return the world position evaluated at the given curvilinear abscissa. :param curvilinear_abscissa: The curvilinear abscissa. Must be valid (0 <= curvilinearAbscissa <= 1). :type curvilinear_abscissa: float :returns: The evaluated position expressed in world coordinates. :rtype: Vector3 :raises ValueError: If the abscissa is invalid. .. py:method:: evaluate_tangent(curvilinear_abscissa) Return the tangent evaluated at the given curvilinear abscissa. :param curvilinear_abscissa: The curvilinear abscissa. Must be valid (0 <= curvilinearAbscissa <= 1). :type curvilinear_abscissa: float :returns: The evaluated tangent expressed in world coordinates. :rtype: Vector3 :raises ValueError: If the abscissa is invalid. .. py:method:: remove_vertex(vertex) Remove the given vertex from the Bezier path. This method invalidate all the indices obtained using :py:obj:`getIndexFromVertex`. :param vertex: Is the vertex guid. Must correspond to the guid of a vertex contained into the Bezier path. :type vertex: str :raises ReadOnlyError: If :py:obj:`Database` is in read only mode. :raises ValueError: If the guid is not the guid of a vertex contained in the Bezier path. .. py:method:: duplicate() Duplicate the Bezier path. :returns: The duplicated bezier path. :rtype: BezierPath :raises ReadOnlyError: If :py:obj:`Database` is in read only mode.