Arrow

class compas_view2.shapes.Arrow(position=[0, 0, 0], direction=[0, 0, 1], head_portion=0.3, head_width=0.1, body_width=0.02)[source]

Bases: Shape

A Arrow is defined by its location and direction vector.

Parameters:
  • position (list of float or compas.geometry.Vector) – The start position of arrow

  • direction (list of float or compas.geometry.Vector) – The height of the cone.

Attributes:
  • head_portion (float) – The portion of head of the arrow

  • head_width (float) – The head width relative to the length of arrow

  • body_width (float) – The body width relative to the length of arrow

Examples

>>> from compas.geometry import Arrow
>>> arrow = Arrow([0, 0, 0], [0, 0, 1])

Methods

from_data

Construct a Arrow from its data representation.

to_vertices_and_faces

Returns a list of vertices and faces.

transform

Transform the Arrow.

Inherited Methods

ToString

Converts the instance to a string.

copy

Make an independent copy of the data object.

from_json

Construct an object from serialized data contained in a JSON file.

from_jsonstring

Construct an object from serialized data contained in a JSON string.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_data

Convert an object to its native data representation.

to_json

Serialize the data representation of an object to a JSON file.

to_jsonstring

Serialize the data representation of an object to a JSON string.

transformed

Returns a transformed copy of this geometry.

validate_data

Validate the object's data against its data schema.

validate_json

Validate the object's data against its json schema.