lagrange.primitive

Functions

generate_disc([radius, start_angle, end_angle, ...])

Generate a disc mesh.

generate_icosahedron([radius, fixed_uv, ...])

Generate an icosahedron mesh.

generate_octahedron([radius, fixed_uv, ...])

Generate an octahedron mesh.

generate_rounded_cone([radius_top, radius_bottom, ...])

Generate a rounded cone mesh.

generate_rounded_cube([width, height, depth, ...])

Generate a rounded cube mesh.

generate_rounded_plane([width, height, bevel_radius, ...])

Generate a rounded plane mesh.

generate_sphere([radius, start_sweep_angle, ...])

Generate a sphere mesh.

generate_subdivided_sphere(base_shape[, radius, ...])

Generate a subdivided sphere mesh from a base shape.

generate_torus([major_radius, minor_radius, ...])

Generate a torus mesh.

Module Contents

lagrange.primitive.generate_disc(radius=1.0, start_angle=0.0, end_angle=6.2831854820251465, radial_sections=32, num_rings=1, triangulate=False, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', dist_threshold=9.999999974752427e-07, angle_threshold=0.5235987901687622, epsilon=9.999999974752427e-07, uv_padding=0.004999999888241291, normal=[0.0, 0.0, 1.0], center=[0.0, 0.0, 0.0])

Generate a disc mesh.

Parameters:
  • radius (float) – The radius of the disc.

  • start_angle (float) – The start angle of the disc in radians.

  • end_angle (float) – The end angle of the disc in radians.

  • radial_sections (int) – The number of radial sections (spokes) in the disc.

  • num_rings (int) – The number of concentric rings in the disc.

  • triangulate (bool) – Whether to triangulate the mesh.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • dist_threshold (float) – The distance threshold for merging vertices.

  • angle_threshold (float) – The angle threshold for merging vertices.

  • epsilon (float) – The epsilon for merging vertices.

  • uv_padding (float) – The padding for the UVs.

  • normal (collections.abc.Sequence[float]) – The normal vector of the disc.

  • center (collections.abc.Sequence[float]) – The center of the disc.

Returns:

The generated mesh.

Return type:

core.SurfaceMesh

lagrange.primitive.generate_icosahedron(radius=1.0, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', angle_threshold=0.5235987901687622, center=[0.0, 0.0, 0.0])

Generate an icosahedron mesh.

Parameters:
  • radius (float) – The radius of the circumscribed sphere around the icosahedron.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • angle_threshold (float) – The angle threshold for merging vertices.

  • center (collections.abc.Sequence[float]) – The center of the icosahedron.

Returns:

The generated mesh.

Return type:

core.SurfaceMesh

lagrange.primitive.generate_octahedron(radius=1.0, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', dist_threshold=9.999999974752427e-07, angle_threshold=0.5235987901687622, epsilon=9.999999974752427e-07, center=[0.0, 0.0, 0.0])

Generate an octahedron mesh.

Parameters:
  • radius (float) – The radius of the circumscribed sphere around the octahedron.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • dist_threshold (float) – The distance threshold for merging vertices.

  • angle_threshold (float) – The angle threshold for merging vertices.

  • epsilon (float) – The epsilon for merging vertices.

  • center (collections.abc.Sequence[float]) – The center of the octahedron.

Returns:

The generated mesh.

Return type:

core.SurfaceMesh

lagrange.primitive.generate_rounded_cone(radius_top=0.0, radius_bottom=1.0, height=1.0, bevel_radius_top=0.0, bevel_radius_bottom=0.0, radial_sections=32, bevel_segments_top=1, bevel_segments_bottom=1, side_segments=1, top_segments=1, bottom_segments=1, start_sweep_angle=0.0, end_sweep_angle=6.2831854820251465, with_top_cap=True, with_bottom_cap=True, with_cross_section=True, triangulate=False, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', dist_threshold=9.999999974752427e-07, angle_threshold=0.5235987901687622, epsilon=9.999999974752427e-07, uv_padding=0.004999999888241291, center=[0.0, 0.0, 0.0])

Generate a rounded cone mesh.

Parameters:
  • radius_top (float) – The radius of the top of the cone.

  • radius_bottom (float) – The radius of the bottom of the cone.

  • height (float) – The height of the cone.

  • bevel_radius_top (float) – The radius of the bevel on the top of the cone.

  • bevel_radius_bottom (float) – The radius of the bevel on the bottom of the cone.

  • radial_sections (int) – The number of radial sections of the cone.

  • bevel_segments_top (int) – The number of segments on the bevel on the top of the cone.

  • bevel_segments_bottom (int) – The number of segments on the bevel on the bottom of the cone.

  • side_segments (int) – The number of segments on the side of the cone.

  • top_segments (int) – The number of segments on the top of the cone.

  • bottom_segments (int) – The number of segments on the bottom of the cone.

  • start_sweep_angle (float) – The start sweep angle of the cone.

  • end_sweep_angle (float) – The end sweep angle of the cone.

  • with_top_cap (bool) – Whether to include the top cap.

  • with_bottom_cap (bool) – Whether to include the bottom cap.

  • with_cross_section (bool) – Whether to include the cross section.

  • triangulate (bool) – Whether to triangulate the mesh.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • dist_threshold (float) – The distance threshold for merging vertices.

  • angle_threshold (float) – The angle threshold for merging vertices.

  • epsilon (float) – The epsilon for merging vertices.

  • uv_padding (float) – The padding for the UVs.

  • center (collections.abc.Sequence[float]) – The center of the cone.

Returns:

The generated mesh.

Return type:

core.SurfaceMesh

lagrange.primitive.generate_rounded_cube(width=1.0, height=1.0, depth=1.0, width_segments=1, height_segments=1, depth_segments=1, bevel_radius=0.0, bevel_segments=8, triangulate=False, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', dist_threshold=9.999999974752427e-07, angle_threshold=0.5235987901687622, epsilon=9.999999974752427e-07, uv_padding=0.004999999888241291, center=[0.0, 0.0, 0.0])

Generate a rounded cube mesh.

Parameters:
  • width (float) – The width of the cube.

  • height (float) – The height of the cube.

  • depth (float) – The depth of the cube.

  • width_segments (int) – The number of segments along the width.

  • height_segments (int) – The number of segments along the height.

  • depth_segments (int) – The number of segments along the depth.

  • bevel_radius (float) – The radius of the bevel on the edges.

  • bevel_segments (int) – The number of segments for the bevel.

  • triangulate (bool) – Whether to triangulate the mesh.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • dist_threshold (float) – The distance threshold for merging vertices.

  • angle_threshold (float) – The angle threshold for merging vertices.

  • epsilon (float) – The epsilon for merging vertices.

  • uv_padding (float) – The padding for the UVs.

  • center (collections.abc.Sequence[float]) – The center of the cube.

Returns:

The generated mesh.

Return type:

core.SurfaceMesh

lagrange.primitive.generate_rounded_plane(width=1.0, height=1.0, bevel_radius=0.0, width_segments=1, height_segments=1, bevel_segments=8, triangulate=False, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', epsilon=9.999999974752427e-07, normal=[0.0, 0.0, 1.0], center=[0.0, 0.0, 0.0])

Generate a rounded plane mesh.

Parameters:
  • width (float) – The width of the plane.

  • height (float) – The height of the plane.

  • bevel_radius (float) – The radius of the bevel on the edges.

  • width_segments (int) – The number of segments along the width.

  • height_segments (int) – The number of segments along the height.

  • bevel_segments (int) – The number of segments for the bevel.

  • triangulate (bool) – Whether to triangulate the mesh.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • epsilon (float) – The epsilon for merging vertices.

  • normal (collections.abc.Sequence[float]) – The unit normal vector for the plane.

  • center (collections.abc.Sequence[float]) – The center of the plane.

Returns:

The generated mesh.

Return type:

core.SurfaceMesh

lagrange.primitive.generate_sphere(radius=1.0, start_sweep_angle=0.0, end_sweep_angle=6.2831854820251465, num_longitude_sections=32, num_latitude_sections=32, triangulate=False, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', dist_threshold=9.999999974752427e-07, angle_threshold=0.5235987901687622, epsilon=9.999999974752427e-07, uv_padding=0.004999999888241291, center=[0.0, 0.0, 0.0])

Generate a sphere mesh.

Parameters:
  • radius (float) – The radius of the sphere.

  • start_sweep_angle (float) – The starting sweep angle in radians.

  • end_sweep_angle (float) – The ending sweep angle in radians.

  • num_longitude_sections (int) – The number of sections along the longitude (vertical) direction.

  • num_latitude_sections (int) – The number of sections along the latitude (horizontal) direction.

  • triangulate (bool) – Whether to triangulate the mesh.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • dist_threshold (float) – The distance threshold for merging vertices.

  • angle_threshold (float) – The angle threshold for merging vertices.

  • epsilon (float) – The epsilon for merging vertices.

  • uv_padding (float) – The padding for the UVs.

  • center (collections.abc.Sequence[float]) – The center of the sphere.

Returns:

The generated mesh.

Return type:

core.SurfaceMesh

lagrange.primitive.generate_subdivided_sphere(base_shape, radius=1.0, subdiv_level=0, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', angle_threshold=0.5235987901687622, center=[0.0, 0.0, 0.0])

Generate a subdivided sphere mesh from a base shape.

Parameters:
  • base_shape (lagrange.core.SurfaceMesh) – The base mesh to subdivide and project onto a sphere.

  • radius (float) – The radius of the resulting sphere.

  • subdiv_level (int) – The number of subdivision levels to apply.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • angle_threshold (float) – The angle threshold for merging vertices.

  • center (collections.abc.Sequence[float]) – The center of the sphere.

Returns:

The generated subdivided sphere mesh.

Return type:

core.SurfaceMesh

lagrange.primitive.generate_torus(major_radius=5.0, minor_radius=1.0, ring_segments=50, pipe_segments=50, start_sweep_angle=0.0, end_sweep_angle=6.2831854820251465, with_top_cap=True, with_bottom_cap=True, with_cross_section=True, triangulate=False, fixed_uv=False, normal_attribute_name='@normal', uv_attribute_name='@uv', semantic_attribute_name='@semantic_label', dist_threshold=9.999999974752427e-07, angle_threshold=0.5235987901687622, epsilon=9.999999974752427e-07, uv_padding=0.004999999888241291, center=[0.0, 0.0, 0.0])

Generate a torus mesh.

Parameters:
  • major_radius (float) – The major radius of the torus.

  • minor_radius (float) – The minor radius of the torus.

  • ring_segments (int) – The number of segments around the ring of the torus.

  • pipe_segments (int) – The number of segments around the pipe of the torus.

  • start_sweep_angle (float) – The start sweep angle of the torus.

  • end_sweep_angle (float) – The end sweep angle of the torus.

  • with_top_cap (bool) – Whether to include the top cap.

  • with_bottom_cap (bool) – Whether to include the bottom cap.

  • with_cross_section (bool) – Whether to include the cross section.

  • triangulate (bool) – Whether to triangulate the mesh.

  • fixed_uv (bool) – Whether to use fixed UVs.

  • normal_attribute_name (str) – The name of the normal attribute.

  • uv_attribute_name (str) – The name of the UV attribute.

  • semantic_attribute_name (str) – The name of the semantic attribute.

  • dist_threshold (float) – The distance threshold for merging vertices.

  • angle_threshold (float) – The angle threshold for merging vertices.

  • epsilon (float) – The epsilon for merging vertices.

  • uv_padding (float) – The padding for the UVs.

  • center (collections.abc.Sequence[float]) – The center of the torus.

Returns:

The generated mesh.

Return type:

core.SurfaceMesh