Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

magnum.primitives module

Primitive library

Enums

class CapsuleFlags: TEXTURE_COORDINATES = 1 TANGENTS = 2 NONE = 0
Capsule flags
class Circle2DFlags: TEXTURE_COORDINATES = 1 NONE = 0
2D circle flags
class Circle3DFlags: TEXTURE_COORDINATES = 1 TANGENTS = 2 NONE = 0
3D circle flags
class ConeFlags: TEXTURE_COORDINATES = 1 TANGENTS = 2 CAP_END = 4 NONE = 0
Cone flags
class CylinderFlags: TEXTURE_COORDINATES = 1 CAP_ENDS = 4 NONE = 0
Cylinder flags
class GridFlags: TEXTURE_COORDINATES = 1 NORMALS = 2 TANGENTS = 4 NONE = 0
Grid flags
class PlaneFlags: TEXTURE_COORDINATES = 1 TANGENTS = 2 NONE = 0
Plane flags
class SquareFlags: TEXTURE_COORDINATES = 1 NONE = 0
Square flags
class UVSphereFlags: TEXTURE_COORDINATES = 1 TANGENTS = 2 NONE = 0
UV sphere flags

Functions

def axis2d() -> trade.MeshData
2D axis
def axis3d() -> trade.MeshData
3D axis
def capsule2d_wireframe(hemisphere_rings: int, cylinder_rings: int, half_length: float) -> trade.MeshData
Wireframe 2D capsule
def capsule3d_solid(hemisphere_rings: int, cylinder_rings: int, segments: int, half_length: float, flags: CapsuleFlags = CapsuleFlags.NONE) -> trade.MeshData
Solid 3D capsule
def capsule3d_wireframe(hemisphere_rings: int, cylinder_rings: int, segments: int, half_length: float) -> trade.MeshData
Wireframe 3D capsule
def circle2d_solid(segments: int, flags: Circle2DFlags = Circle2DFlags.NONE) -> trade.MeshData
Solid 2D circle
def circle2d_wireframe(segments: int) -> trade.MeshData
Wireframe 2D circle
def circle3d_solid(segments: int, flags: Circle3DFlags = Circle3DFlags.NONE) -> trade.MeshData
Solid 3D circle
def circle3d_wireframe(segments: int) -> trade.MeshData
Wireframe 3D circle
def cone_solid(rings: int, segments: int, half_length: float, flags: ConeFlags = ConeFlags.NONE) -> trade.MeshData
Solid 3D cone
def cone_wireframe(segments: int, half_length: float) -> trade.MeshData
Wireframe 3D cone
def crosshair2d() -> trade.MeshData
2D crosshair
def crosshair3d() -> trade.MeshData
3D crosshair
def cube_solid() -> trade.MeshData
Solid 3D cube
def cube_solid_strip() -> trade.MeshData
Solid 3D cube as a single strip
def cube_wireframe() -> trade.MeshData
Wireframe 3D cube
def cylinder_solid(rings: int, segments: int, half_length: float, flags: CylinderFlags = CylinderFlags.NONE) -> trade.MeshData
Solid 3D cylinder
def cylinder_wireframe(rings: int, segments: int, half_length: float) -> trade.MeshData
Wireframe 3D cylinder
def gradient2d(a: Vector2, color_a: Color4, b: Vector2, color_b: Color4) -> trade.MeshData
2D square with a gradient
def gradient2d_horizontal(color_left: Color4, color_right: Color4) -> trade.MeshData
2D square with a horizontal gradient
def gradient2d_vertical(color_bottom: Color4, color_top: Color4) -> trade.MeshData
2D square with a vertical gradient
def gradient3d(a: Vector3, color_a: Color4, b: Vector3, color_b: Color4) -> trade.MeshData
3D plane with a gradient
def gradient3d_horizontal(color_left: Color4, color_right: Color4) -> trade.MeshData
3D plane with a horizontal gradient
def gradient3d_vertical(color_bottom: Color4, color_top: Color4) -> trade.MeshData
3D plane with a vertical gradient
def grid3d_solid(subdivisions: Vector2i, flags: GridFlags = GridFlags.NORMALS) -> trade.MeshData
Solid 3D grid
def grid3d_wireframe(arg0: Vector2i, /) -> trade.MeshData
Wireframe 3D grid
def icosphere_solid(subdivisions: int) -> trade.MeshData
def line2d(a: Vector2, b: Vector2) -> trade.MeshData
2D line
def line2d() -> trade.MeshData
2D line in an identity transformation
def line3d(a: Vector3, b: Vector3) -> trade.MeshData
3D line
def line3d() -> trade.MeshData
3D line in an identity transformation
def plane_solid(flags: PlaneFlags = PlaneFlags.NONE) -> trade.MeshData
Solid 3D plane
def plane_wireframe() -> trade.MeshData
Wireframe 3D plane
def square_solid(flags: SquareFlags = SquareFlags.NONE) -> trade.MeshData
Solid 2D square
def square_wireframe() -> trade.MeshData
Wireframe 2D square
def uv_sphere_solid(rings: int, segments: int, flags: UVSphereFlags = UVSphereFlags.NONE) -> trade.MeshData
Solid 3D UV sphere
def uv_sphere_wireframe(rings: int, segments: int) -> trade.MeshData
Wireframe 3D UV sphere