Skip to content

Primitives Module

Basic solid primitive creation (box, sphere, cylinder, etc.).

LightOcct::LPrim

Light OCCT primitive creation factory following enum + Handle pattern.

Provides comprehensive 3D primitive creation capabilities using OCCT BRepPrimAPI. Follows Light OCCT architectural patterns: Static factory methods for primitive creation POD structures with coordinate system architecture No OCCT types exposed in public interface Multi-language binding compatibility Optional module with BUILD_PRIMITIVES=ON/OFF Supported primitive types: Basic Solids: Box, Sphere, Cylinder, Cone, Torus, Wedge Revolution Solids: Revolve profiles around axis Extrusion Solids: Extrude profiles along direction/vector Swept Solids: Pipe, Loft operations All methods return objects that can be used with the topology system. LShape

cpp
#include <light-occt/primitives/LPrim.hxx>

Quick Reference

Factory Methods: CreateBox(), CreateBox(), CreateSphere(), CreateCylinder(), CreateCone(), CreateTorus(), IsAvailable(), GetVersion()

Methods: LPrim(), ~LPrim(), LPrim(), operator=()


Methods

Factory Methods

CreateBox

Create box primitive with coordinate system placement.

cpp
static LShape CreateBox(const  & Axis3Placement position, double dx, double dy, double dz);

position Coordinate system defining box orientation (Z=height, X=width, Y=depth) dx Width along local X axis dy Depth along local Y axis dz Height along local Z axis Box solid shape

Parameters:

  • position - Coordinate system defining box orientation (Z=height, X=width, Y=depth) dx Width along local X axis dy Depth along local Y axis dz Height along local Z axis Box solid shape
  • dx - Width along local X axis dy Depth along local Y axis dz Height along local Z axis Box solid shape
  • dy - Depth along local Y axis dz Height along local Z axis Box solid shape
  • dz - Height along local Z axis Box solid shape
CreateBox

Create box primitive from two opposite corner points.

cpp
static LShape CreateBox(const  & Point point1, const  & Point point2);

point1 First corner point point2 Opposite corner point Box solid shape

Parameters:

  • point1 - First corner point point2 Opposite corner point Box solid shape
  • point2 - Opposite corner point Box solid shape
CreateSphere

Create sphere primitive with coordinate system placement.

cpp
static LShape CreateSphere(const  & Axis3Placement position, double radius);

position Coordinate system defining sphere orientation radius Sphere radius Complete sphere solid shape

Parameters:

  • position - Coordinate system defining sphere orientation radius Sphere radius Complete sphere solid shape
  • radius - Sphere radius Complete sphere solid shape
CreateCylinder

Create cylinder primitive from axis and parameters.

cpp
static LShape CreateCylinder(const  & Axis1Placement axis, double radius, double height);

axis Cylinder axis (location + direction) radius Cylinder radius height Cylinder height Complete cylinder solid shape

Parameters:

  • axis - Cylinder axis (location + direction) radius Cylinder radius height Cylinder height Complete cylinder solid shape
  • radius - Cylinder radius height Cylinder height Complete cylinder solid shape
  • height - Cylinder height Complete cylinder solid shape
CreateCone

Create cone primitive from axis and radii.

cpp
static LShape CreateCone(const  & Axis1Placement axis, double radius1, double radius2, double height);

axis Cone axis (location + direction) radius1 Bottom radius (at axis location) radius2 Top radius (at height distance) height Cone height Cone solid shape

Parameters:

  • axis - Cone axis (location + direction) radius1 Bottom radius (at axis location) radius2 Top radius (at height distance) height Cone height Cone solid shape
  • radius1 - Bottom radius (at axis location) radius2 Top radius (at height distance) height Cone height Cone solid shape
  • radius2 - Top radius (at height distance) height Cone height Cone solid shape
  • height - distance) height Cone height Cone solid shape
CreateTorus

Create torus primitive from axis and radii.

cpp
static LShape CreateTorus(const  & Axis1Placement axis, double majorRadius, double minorRadius);

axis Torus axis (location + direction, center axis) majorRadius Major radius (distance from center axis to tube center) minorRadius Minor radius (tube radius) Complete torus solid shape

Parameters:

  • axis - Torus axis (location + direction, center axis) majorRadius Major radius (distance from center axis to tube center) minorRadius Minor radius (tube radius) Complete torus solid shape
  • majorRadius - Major radius (distance from center axis to tube center) minorRadius Minor radius (tube radius) Complete torus solid shape
  • minorRadius - Minor radius (tube radius) Complete torus solid shape
IsAvailable

Check if primitives module is available at runtime.

cpp
static bool IsAvailable();

True if primitives module was built and is available

GetVersion

Get module version information.

cpp
static const char * GetVersion();

Version string for primitives module

Instance Methods

LPrim
cpp
 LPrim() const;
~LPrim
cpp
 ~LPrim() const;
LPrim
cpp
 LPrim(const  & LPrim other) const;
operator=
cpp
& LPrim operator=(const  & LPrim other) const;

Released under the LGPL-2.1 License