Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SbExtrusionGenerator Class Reference

Factory that generates an extruded mesh from a polyline. More...

#include <Inventor/misc/SbExtrusionGenerator.h>

Static Public Member Functions

static SoShapecreateFrom3DPoints (const std::vector< SbVec3f > &pointsInWorld, SoPath *nodePath, const SbViewVolume &volume, const SbBox3f &bboxInLocal=SbBox3f())
 Create an extruded shape from points in world space.
 
static SoShapecreateFrom2DPoints (const std::vector< SbVec2f > &pointsInCam, SoPath *nodePath, const SbViewVolume &volume, const SbBox3f &bboxInLocal=SbBox3f())
 Create an extruded shape from points in camera space.
 
static SoShapecreateFrom2DPoints (const std::vector< SbVec2f > &pointsInCam, const SbMatrix &localToCam, const SbBox3f &bboxInLocal=SbBox3f())
 Create an extruded shape from points in camera space.
 
static SoShapecreateFrom2DPoints (const std::vector< SbVec2f > &pointsInCam, const SbMatrix &camToLocal, float zMin=-1.0f, float zMax=1.0f)
 Create an extruded shape from points in camera space.
 

Detailed Description

Factory that generates an extruded mesh from a polyline.

This class generates an extruded shape from a simple or a complex polyline. The line is extruded between the 2 planes parallel that can be specified with a boundingBox or directly in camera space (see createFrom2DPoints() methods) The generated shape is closed and contains only triangles in CCW order.

LIMITATIONS

  • Only vertices are handled in the generated shape, none of the normal, color or texCoord properties are taken into account.

NOTES

  • In an orthographic view, the polyline is extruded along the view vector (normal to the camera plane), but in a perspective view the generated shape is a truncated cone with a larger base farther from the camera, due to the perspective transform.
  • Local space refers to the space in which the shape will be expressed.

Definition at line 58 of file SbExtrusionGenerator.h.

Member Function Documentation

◆ createFrom2DPoints() [1/3]

static SoShape * SbExtrusionGenerator::createFrom2DPoints ( const std::vector< SbVec2f > &  pointsInCam,
const SbMatrix camToLocal,
float  zMin = -1.0f,
float  zMax = 1.0f 
)
static

Create an extruded shape from points in camera space.

Parameters
pointsInCamPolyline in normalized screen space ([-1, 1]x[-1, 1]).
camToLocalTransform matrix from camera space to local space (modelViewProjInv matrix)
zMinMin extrusion plane, in camera space. By default, it's the camera's near clip plane.
zMaxMax extrusion plane, in camera space. By default, it's the camera's far clip plane.
Warning
Return NULL if error occurred.

◆ createFrom2DPoints() [2/3]

static SoShape * SbExtrusionGenerator::createFrom2DPoints ( const std::vector< SbVec2f > &  pointsInCam,
const SbMatrix localToCam,
const SbBox3f bboxInLocal = SbBox3f() 
)
static

Create an extruded shape from points in camera space.

Parameters
pointsInCamPolyline in normalized screen space ([-1, 1]x[-1, 1]).
localToCamTransform matrix from local space to camera space (modelViewProj matrix)
bboxInLocalBounding box that specifies limits of extruded shape, expressed in local space. If not specified, the shape will be extruded between the camera near and far planes.
Warning
Return NULL if error occurred.

◆ createFrom2DPoints() [3/3]

static SoShape * SbExtrusionGenerator::createFrom2DPoints ( const std::vector< SbVec2f > &  pointsInCam,
SoPath nodePath,
const SbViewVolume volume,
const SbBox3f bboxInLocal = SbBox3f() 
)
static

Create an extruded shape from points in camera space.

Parameters
pointsInCamPolyline in normalized screen space ([-1, 1]x[-1, 1]).
nodePathPath from root to the node space in which the generated shape will be expressed. Generally, the separator which will contain the shape. If NULL, the shape will be expressed in world space.
volumeView volume corresponding to the camera in which the points were taken.
bboxInLocalBounding box that specifies limits of extruded shape, expressed in local space. If not specified, the shape will be extruded between the camera near and far planes.
Warning
Return NULL if error occurred.

◆ createFrom3DPoints()

static SoShape * SbExtrusionGenerator::createFrom3DPoints ( const std::vector< SbVec3f > &  pointsInWorld,
SoPath nodePath,
const SbViewVolume volume,
const SbBox3f bboxInLocal = SbBox3f() 
)
static

Create an extruded shape from points in world space.

Parameters
pointsInWorldPolyline in world space.
nodePathPath from root to the node space in which the generated shape will be expressed. Generally, the separator which will contain the shape. If NULL, the shape will be expressed in world space.
volumeView volume corresponding to the camera in which the points were taken.
bboxInLocalBounding box that specifies limits of extruded shape, expressed in local space. If not specified, the shape will be extruded between the camera near and far planes.
Warning
Return NULL if error occurred.

The documentation for this class was generated from the following file: