API / geotoolkit3d / util / intersection / Intersection3DUtil / Intersection3DUtil
intersection.Intersection3DUtil.Intersection3DUtil
Type Aliases
Type Aliases
Ƭ CommonResult: Object
Common intersection result shared by different intersection type.
| Name | Type | Description |
|---|---|---|
colorprovidera | ColorProvider | The colorprovider of the object A. If no colorprovider, the object material's solid color and opacity will be returned as ColorProvider. |
colorproviderb | ColorProvider | The colorprovider of the object B. If no colorprovider, return the object material's solid color and opacity will be returned as ColorProvider. |
nullvaluea | number | null | The nullvalue for the object A values (if applicable). nullvalues are used to represent values that should be ignored and not rendered. |
nullvalueb | number | null | The nullvalue for the object B values (if applicable). nullvalues are used to represent values that should be ignored and not rendered. |
Ƭ Intersectable: Mesh | IIntersectableMesh | IIntersectablePolyhedron
Object types eligible for intersection.
Three.js Mesh must not be instanced, if so, users need to implement one of the Intersectable interfaces such as IIntersectableMesh.
Ƭ IntersectionOptions: Object
Options for Intersection3DUtil.intersectObjects().
| Name | Type | Description |
|---|---|---|
computevalue? | boolean | If true, the method will compute and return the value of the intersected points if values are available. The values can either from object A or/and object B and can be used to color the intersection with color provider. Default value is true. |
Ƭ LineOptions: Object
Options for line segments.
More options can be set directly on the resulting line segments visual object, please see LineSegments#setOptions for more details.
| Name | Type | Description |
|---|---|---|
generatelines? | boolean | If true and if the intersection produce lines, Line visual will be generated. Default is true. |
linewidth? | number | The line width. Default value is 3; |
polygonoffset? | boolean | If true, will enable polygon offset to prevent z-fighting. polygon offset apply a negative offset on the camera Z axis in the shaders, to make the line more 'in front' of the other objects, reducing depth buffer occlusion by other objects. Default value is true. |
polygonoffsetfactor? | number | Factors for polygon offset. Default value is 4. |
Ƭ LinesResult: Object
Intersection result as line segments
| Name | Type | Description |
|---|---|---|
positions | number[] | Intersection result as pair of points/segments [a1x, a1y, a1z, b1x, b1y, b1z, a2x, a2y, a2z, b2x, b2y, b2z, etc]. Might be empty if the intersection produced no lines. |
valuea? | number[] | The intersected points values for object A (if applicable). One value per point. |
valueb? | number[] | The intersected points values for object B (if applicable). One value per point. |
Ƭ MeshMeshResult: CommonResult & { lines: LinesResult ; points: PointsResult ; polygons: PolygonsResult }
The result of the intersection between two mesh objects.
Mesh includes Toolkit objects like Plane, PlaneCurtain, Surface, native Three.js Mesh, and custom intersectable mesh object if implements IIntersectableMesh.
When two surfaces intersect, the result may contains points, lines, or polygons, depending on how they intersect.
Ƭ MeshPolyhedronResult: CommonResult & { polygons: PolygonsResult & PolyhedronCellIndices }
The result of the intersection between mesh and polyhedron cell objects.
Mesh includes Toolkit objects like Plane, PlaneCurtain, Surface, native Three.js Mesh, and custom intersectable mesh object if implements IIntersectableMesh.
Polyhedron cell objects includes Toolkit objects like ReservoirGrid and custom intersectable polyhedron object implementing IIntersectablePolyhedron.
When mesh and polyhedron intersects, the result contains polygons.
Ƭ OutlineVisualOptions: Object
The options for outline visuals. More options can be set later on the LineSegment object visual itself.
| Name | Type | Description |
|---|---|---|
color? | RgbaColor | Color | string | Use this color for the outline visual. Default is 'red'. String are named colors like 'red', 'lightblue', 'darkgreen' etc. To use CSS Colors, parse them with the RgbaColor class. |
linewidth? | number | Define the line width, in pixels, for the outline visual. Decimal values like 1.5 are supported. Default is 2. |
Ƭ PlaneObject: IOverlayableObject
Plane object to project 3D intersection result.
In Toolkit, plane objects include FencePanel, Slice, and Plane.
Ƭ PointOptions: Object
Options for points.
More options can be set directly on the resulting points visual object, please see PointSet#setOptions for more details.
| Name | Type | Description |
|---|---|---|
generatepoints? | boolean | If true and if the intersection produce points, Point visual will be generated. Default is true. |
pointsize? | number | Size of the points. Default value is 5; |
pointsizeindevice? | boolean | True if the point size should only depend on their value, ignores the projection and any scale. Default is false. |
Ƭ PointsResult: Object
Intersection result as individual points
| Name | Type | Description |
|---|---|---|
positions | number[] | Intersection result as individual points [p1x, p1y, p1z, p2x, p2y, p2z, etc]. Might be empty if the intersection produced no points. |
valuea? | number[] | The intersected points values for object A (if applicable). One value per point. |
valueb? | number[] | The intersected points values for object B (if applicable). One value per point. |
Ƭ PolygonOptions: Object
Options for polygons.
More options can be set directly on the resulting polygon visual object, please see Surface#setOptions for more details.
| Name | Type | Description |
|---|---|---|
enableshading? | boolean | If true the surface will compute lighting effect. Default is false. |
generatepolygons? | boolean | If true and if the intersection produce polygons, Surface visual will be generated. Default is true. |
polygonoffset? | boolean | If true, will enable polygon offset to prevent z-fighting. polygon offset apply a negative offset on the camera Z axis in the shaders, to make the line more 'in front' of the other objects, reducing depth buffer occlusion by other objects. Default value is true. |
polygonoffsetfactor? | number | Factors for polygon offset. Default value is 4. |
Ƭ PolygonsResult: Object
Intersection result as polygons
| Name | Type | Description |
|---|---|---|
positions | number[] | Intersection result as individual triangles, each triangle is 3 point, and each point is 3 values (x,y,z) in the format [t1x1, t1y1, t1z1, t1x2, t1y2, t1z2, t1x3, t1y3, t1z3, t2x1,etc...]. In short there is 9 values per triangle. Might be empty if the intersection produced no polygons. |
valuea? | number[] | The intersected points values for object A (if applicable). One value per point, so 3 values per triangle. |
valueb? | number[] | The intersected points values for object B (if applicable). One value per point, so 3 values per triangle. |
Ƭ PolyhedronCellIndices: Object
When performing Polyhedrons intersection, this additional index array specify the index of the cell the intersection result belongs to.
| Name | Type | Description |
|---|---|---|
cellindices | number[] | The index array specifying the index of the cell the intersection result belongs to. There is one index per triangle result, meaning the array size ratio of indices to position and values is:
|
Ƭ Result: MeshMeshResult & { type: MeshMesh } | MeshPolyhedronResult & { type: MeshPolyhedron }
Intersection results.
The content will change based on the intersected objects and options.
When a mesh intersecting another mesh will produce Intersection3DUtil.MeshMeshResult.
When a mesh intersecting polyhedron will produce Intersection3DUtil.MeshPolyhedronResult.
Ƭ Result2D: MeshMeshResult & { rect: Rect ; type: MeshMesh } | MeshPolyhedronResult & { rect: Rect ; type: MeshPolyhedron }
Projected intersection results.
Result2D is the result that project 3D intersection result to a given 2D plane.
They shared the same structure as 3D result Intersection3DUtil.Result, except the z coordinates of the result are all zero.
The Rect bounds of the given plane is also returned, so that the result can be transformed to any texture or canvas.
Ƭ VisualOptions: Object
The options for Intersection3DUtil.generateIntersectionVisuals() to generate the visual representation of the intersection result.
| Name | Type | Description |
|---|---|---|
colorprovidertouse? | ColorProviderName | Which object's colorprovider or color to use for the visual. If overridecolorprovider is provided, we will use the override color instead of the colorprovidertouse. |
lineoptions? | LineOptions | Options for line segments created from Intersection3DUtil.Result.lines |
overridecolorprovider? | ColorProvider | RgbaColor | string | Use this colorprovider/color for the visual, instead of the intersected object's. |
pointoptions? | PointOptions | Options for points created from Intersection3DUtil.Result.points |
polygonoptions? | PolygonOptions | Options for polygons created from Intersection3DUtil.Result.polygons |
valuestouse? | ValueName | Which object values to use with the colorprovider. It is possible to use ObjectA values with ObjectB ColorProvider if desired (or vice-versa), but this only make sense if both objects share the same property or same colorMap. |
Ƭ VisualResult: Object
Result for visual object of intersection
| Name | Type | Description |
|---|---|---|
linesegments | LineSegments | null | LineSegments to visualize intersection lines. |
pointset | PointSet | null | PointSet to visualize intersection points. |
surface | Surface | null | Surface to visualize intersection polygons. |