SoRenderSurfaceIntersection¶
- InventorModule¶
author
package
dll
definition
keywords
Purpose¶
The SoRenderSurfaceIntersection allows for rendering the intersection of 3D triangle meshes with a given world plane.
The intersection is rendered using anti-aliased lines. The module has a GPU implementation that requires OpenGL 2.0 and geometry shaders. It also has a CPU fallback implementation if no hardware support is available. The CPU fallback will be used on Mesa and Intel hardware by default.
The module supports filling of the intersection but only if the objects are closed. If supported by the hardware, the GPU will be used for the filling. If filling is not supported on the GPU, the software intersection calculation is used for the filling. The software implementation is especially picky about the closedness, which causes SoSphere to not always be filled correctly because Open Inventor has (albeit very small) holes in its spheres.
An alternative to :module’SoSphere is to use WEMInitialize to generate a sphere instead.
The CPU filling implementation behaves differently regarding objects inside other objects, it uses the color from the last contour it entered from left to right and fills scan-line by scan-line. The GPU implementation adds up the colors in 3D and will show the sum of the colors of all objects that lie inside each other.
Stippling is not supported by the GPU implementation, the module will automatically use the software intersection renderer if stippling is enabled.
Note: Only triangle meshes are supported, that means points, lines, quads, and polygons are not supported.
If you are using WEM rendering, ensure that it consists of triangles only. You can use WEMModify to triangulate any WEM mesh. On Nvidia hardware, quads seem to work as well; however, quads definitely do not function on AMD graphics cards. Convert quads to triangles when using them with this module to achieve cross-platform compatibility.
Example usage:
Usage¶
The module can be used to draw the intersections both in 3D or onto a SoView2D using SoView2DScene.
In the case of using the SoView2DScene, the module automatically uses the current SoView2D slice as the intersection plane if SoView2DScene.useSlabRenderingPlane is enabled.
Tips¶
Ensure that you enable double-sided rendering (e.g., in the SoWEMRenderer) or add a SoShapeHints module to force double-sided rendering; otherwise, back faces will not be handled correctly.
Input Fields¶
child¶
- name: child, type: SoNode¶
The Open Inventor scene that should be intersected. Make sure that the scene only contains triangle meshes!
Output Fields¶
self¶
- name: self, type: SoNode¶
Parameter Fields¶
Field Index¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
Visible Fields¶
Color¶
- name: color, type: Color, default: 1 1 1¶
Sets the color of the intersection.
Alpha¶
- name: alpha, type: Float, default: 1, minimum: 0, maximum: 1¶
Sets the alpha blending value of the intersection.
Line Width¶
- name: lineWidth, type: Float, default: 2, minimum: 0.1, maximum: 10¶
Sets the line width.
Albedo Mix¶
- name: albedoMix, type: Float, default: 1, minimum: 0, maximum: 1¶
Sets how much of the geometry color is mixed in (0 = color field only, 1 = color * geometry color).
Line Style¶
- name: lineStyle, type: Enum, default: SOLID¶
Defines the line style (stipple pattern).
Note that only the SOLID style is supported by the geometry shader implementation, so any other pattern will cause the module to revert to the CPU implementation.
Values:
Title |
Name |
Description |
|---|---|---|
Solid |
SOLID |
SOLID |
Dashed |
DASHED |
DASHED |
Short Dashed |
SHORT_DASHED |
SHORT DASHED |
Dotted |
DOTTED |
DOTTED |
Plane Offset¶
- name: planeOffset, type: Float, default: 0¶
Sets an offset for the intersection plane.
Plane Position¶
- name: planePosition, type: Enum, default: SlabCenter¶
Defines the relative position of the plane on the slab.
Values:
Title |
Name |
|---|---|
Start |
SlabStart |
Center |
SlabCenter |
End |
SlabEnd |
Line Style Scale¶
- name: lineStyleScale, type: Integer, default: 1, minimum: 1, maximum: 16¶
Sets a scale factor for the stippling pattern.
Fill Inside¶
- name: fillInside, type: Bool, default: TRUE¶
If checked, the filling of the inside is enabled. This requires a second rendering pass.
Inside Color¶
- name: insideColor, type: Color, default: 1 1 1¶
Sets the color to use for the interior.
Inside Alpha¶
- name: insideAlpha, type: Float, default: 0.5, minimum: 0, maximum: 1¶
Sets the alpha factor for the interior.
Inside Albedo Mix¶
- name: insideAlbedoMix, type: Float, default: 1, minimum: 0, maximum: 1¶
Sets the amount of mixing in the interior geometry color (0 = insideColor field only, 1 = insideColor * geometry color).
Use GPU filling¶
- name: useGPUFilling, type: Bool, default: TRUE¶
If checked, the GPU is used for filling the intersection of closed objects.
If the geometry shader is used for rendering the intersection, filling occurs solely on the GPU, regardless of this setting. GPU filling typically works on AMD, Nvidia, Mesa, and Intel hardware.
Use Geometry Shader¶
- name: useGeometryShader, type: Bool, default: TRUE¶
If checked, the module utilizes the geometry shader to calculate the intersection and filling on the GPU.
This will only be used if the hardware supports it; see
Geometry Shader Supported.
Geometry Shader Supported¶
- name: geometryShaderSupported, type: Bool, persistent: no¶
Shows whether the current hardware supports geometry shaders.
This feature is off by default on Mesa and Intel systems.
GPU filling supported¶
- name: gpuFillingSupported, type: Bool, persistent: no¶
Shows whether filling with the GPU is supported.