Geometry#

vivid3d.create_cube(position: Point3D = array([0., 0., 0.], dtype=float32), size: float = 1, color: str = 'lightgray', opacity: float = 1.0, label: str = 'cube') vivid3d._core.Mesh#

Create a Cube mesh

Parameters
  • position (Point3D, default: [0,0,0]) – The center of the mesh.

  • size (float, default: 1.0) – The distance of the vertices from the position.

  • color (str, default: 'lightgray') – The color of the resulting mesh.

  • opacity ((0.0-1.0), default: 1.0) – Float in the range of 0.0 - 1.0 indicating how transparent the material is. A value of 0.0 indicates fully transparent, 1.0 is fully opaque.

  • label (str, default: 'cube') – Optional name of the object, not required to be unique.

Returns

mesh (vivid3d.Mesh) – The cube mesh

vivid3d.create_box(position: Point3D = array([0., 0., 0.], dtype=float32), size: Point3D = array([1., 1., 1.], dtype=float32), color: str = 'lightgray', opacity: float = 1.0, label: str = 'box') vivid3d._core.Mesh#

Create a Box mesh

Parameters
  • position (Point3D, default: [0,0,0]) – The center of the mesh.

  • size (Point3D, default: [1,1,1]) – The distance of the vertices[X,Y,Z] from the position[X,Y,Z].

  • color (str, default: 'lightgray') – The color of the resulting mesh.

  • opacity ((0.0-1.0), default: 1.0) – Float in the range of 0.0 - 1.0 indicating how transparent the material is. A value of 0.0 indicates fully transparent, 1.0 is fully opaque.

  • label (str, default: 'box') – Optional name of the object, not required to be unique.

Returns

mesh (vivid3d.Mesh) – The box mesh

vivid3d.create_plane(position: Point3D = array([0., 0., 0.], dtype=float32), size: float = 1, color: str = 'lightgray', opacity: float = 1.0, label: str = 'plane') vivid3d._core.Mesh#

Create a 2D Plane mesh

Parameters
  • position (Point3D, default: [0,0,0]) – The center of the mesh.

  • size (float, default: 1.0) – The distance of the vertices from the position.

  • color (str, default: 'lightgray') – The color of the resulting mesh.

  • opacity ((0.0-1.0), default: 1.0) – Float in the range of 0.0 - 1.0 indicating how transparent the material is. A value of 0.0 indicates fully transparent, 1.0 is fully opaque.

  • label (str, default: 'plane') – Optional name of the object, not required to be unique.

Returns

mesh (vivid3d.Mesh) – The 2D Plane mesh

vivid3d.create_sphere(position: Point3D = array([0., 0., 0.], dtype=float32), radius: float = 1, num_of_meridians: int = 20, num_of_parallels: int = 20, color: str = 'lightgray', opacity: float = 1.0, label: str = 'sphere') vivid3d._core.Mesh#

Create a Sphere mesh

Parameters
  • position (Point3D, default: [0,0,0]) – The center of the mesh.

  • radius (float, default: 1.0) – The radius from the position.

  • num_of_meridians (int, default: 20) – How many horizontal slices to subdivide the sphere mesh.

  • num_of_parallels (int, default: 20) – How many vertical slices to subdivide the sphere mesh.

  • color (str, default: 'lightgray') – The color of the resulting mesh.

  • opacity ((0.0-1.0), default: 1.0) – Float in the range of 0.0 - 1.0 indicating how transparent the material is. A value of 0.0 indicates fully transparent, 1.0 is fully opaque.

  • label (str, default: 'sphere') – Optional name of the object, not required to be unique.

Returns

mesh (vivid3d.Mesh) – The sphere mesh

vivid3d.create_ellipsoid(position: Point3D = array([0., 0., 0.], dtype=float32), radii: Point3D, num_of_meridians: int = 20, num_of_parallels: int = 20, major_axis: Point3D, middle_axis: Point3D, minor_axis: Point3D, color: str = 'lightgray', opacity: float = 1.0, label: str = 'ellipsoid') vivid3d._core.Mesh#

Create an Ellipsoid mesh

Parameters
  • position (Point3D, default: [0,0,0]) – The center of the mesh.

  • radii (Point3D) – The major, middle, and minor axis radii.

  • num_of_meridians (int, default: 20) – How many horizontal slices to subdivide the sphere mesh.

  • num_of_parallels (int, default: 20) – How many vertical slices to subdivide the sphere mesh.

  • major_axis (Point3D) – The unit vector for ellipsoid major axis.

  • middle_axis (Point3D) – The unit vector for ellipsoid middle axis.

  • minor_axis (Point3D) – The unit vector for ellipsoid minor axis.

  • color (str, default: 'lightgray') – The color of the resulting mesh.

  • opacity ((0.0-1.0), default: 1.0) – Float in the range of 0.0 - 1.0 indicating how transparent the material is. A value of 0.0 indicates fully transparent, 1.0 is fully opaque.

  • label (str, default: 'ellipsoid') – Optional name of the object, not required to be unique.

Returns

mesh (vivid3d.Mesh) – The ellipsoid mesh

vivid3d.create_arrow(position: Point3D = array([0., 0., 0.], dtype=float32), direction: Point3D, width: float = 0.5, pointer_chest_ratio: float = 0.4, color: str = 'lightgray', opacity: float = 1, label: str = 'arrow') vivid3d._core.Mesh#

Create an Arrow mesh

Parameters
  • position (Point3D, default: [0,0,0]) – The center of the mesh.

  • direction (Point3D) – The direction and length of the arrow from the position.

  • width (float, default: 0.5) – The width of the arrow mesh.

  • pointer_chest_ratio (float, default: 0.4) – The pointer to chest ratio.

  • color (str, default: 'lightgray') – The color of the resulting mesh.

  • opacity ((0.0-1.0), default: 1.0) – Float in the range of 0.0 - 1.0 indicating how transparent the material is. A value of 0.0 indicates fully transparent, 1.0 is fully opaque.

  • label (str, default: 'arrow') – Optional name of the object, not required to be unique.

Returns

mesh (vivid3d.Mesh) – The arrow mesh

vivid3d.create_grid(size: float = 10, num_of_ticks: int = 5, tick_size: float = 1) Tuple[vivid3d._core.Lines, vivid3d._core.Lines]#

Create a Grid mesh, origin is at [0,0,0]

Parameters
  • size (float, default: 1.0) – The size of the grid from [0,0,0]

  • num_of_ticks (int, default: 5) – The number of ticks between each major tick.

  • tick_size (float, default: 1) – The size of ticks.

Returns

vivid3d.Lines – The grid mesh

User Guide#