Last updated

API / geotoolkit3d / util / intersection / Intersection3DUtil / Intersection3DUtil

Namespace: Intersection3DUtil

intersection.Intersection3DUtil.Intersection3DUtil

Table of contents

Type Aliases

Contents

Type Aliases

CommonResult

Ƭ CommonResult: Object

Common intersection result shared by different intersection type.

Type declaration

NameTypeDescription
colorprovideraColorProviderThe colorprovider of the object A. If no colorprovider, the object material's solid color and opacity will be returned as ColorProvider.
colorproviderbColorProviderThe colorprovider of the object B. If no colorprovider, return the object material's solid color and opacity will be returned as ColorProvider.
nullvalueanumber | nullThe nullvalue for the object A values (if applicable).
nullvalues are used to represent values that should be ignored and not rendered.
nullvaluebnumber | nullThe nullvalue for the object B values (if applicable).
nullvalues are used to represent values that should be ignored and not rendered.

Intersectable

Ƭ 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

Ƭ IntersectionOptions: Object

Options for Intersection3DUtil.intersectObjects().

Type declaration

NameTypeDescription
computevalue?booleanIf 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

Ƭ 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.

Type declaration

NameTypeDescription
generatelines?booleanIf true and if the intersection produce lines, Line visual will be generated.
Default is true.
linewidth?numberThe line width.
Default value is 3;
polygonoffset?booleanIf 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?numberFactors for polygon offset.
Default value is 4.

LinesResult

Ƭ LinesResult: Object

Intersection result as line segments

Type declaration

NameTypeDescription
positionsnumber[]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

Ƭ 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

Ƭ 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

Ƭ OutlineVisualOptions: Object

The options for outline visuals. More options can be set later on the LineSegment object visual itself.

Type declaration

NameTypeDescription
color?RgbaColor | Color | stringUse 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?numberDefine the line width, in pixels, for the outline visual.
Decimal values like 1.5 are supported. Default is 2.

PlaneObject

Ƭ PlaneObject: IOverlayableObject

Plane object to project 3D intersection result.
In Toolkit, plane objects include FencePanel, Slice, and Plane.


PointOptions

Ƭ PointOptions: Object

Options for points.
More options can be set directly on the resulting points visual object, please see PointSet#setOptions for more details.

Type declaration

NameTypeDescription
generatepoints?booleanIf true and if the intersection produce points, Point visual will be generated.
Default is true.
pointsize?numberSize of the points.
Default value is 5;
pointsizeindevice?booleanTrue if the point size should only depend on their value, ignores the projection and any scale.
Default is false.

PointsResult

Ƭ PointsResult: Object

Intersection result as individual points

Type declaration

NameTypeDescription
positionsnumber[]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

Ƭ PolygonOptions: Object

Options for polygons.
More options can be set directly on the resulting polygon visual object, please see Surface#setOptions for more details.

Type declaration

NameTypeDescription
enableshading?booleanIf true the surface will compute lighting effect. Default is false.
generatepolygons?booleanIf true and if the intersection produce polygons, Surface visual will be generated.
Default is true.
polygonoffset?booleanIf 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?numberFactors for polygon offset.
Default value is 4.

PolygonsResult

Ƭ PolygonsResult: Object

Intersection result as polygons

Type declaration

NameTypeDescription
positionsnumber[]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

Ƭ PolyhedronCellIndices: Object

When performing Polyhedrons intersection, this additional index array specify the index of the cell the intersection result belongs to.

Type declaration

NameTypeDescription
cellindicesnumber[]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:
  • 1 Index for 3 property values (value array length == 3 * indices array length)
  • 1 Index for 3 points, so 9 coordinate values (position array length == 9 * indices array length)
With theses indices, it is possible to regroup intersection results by cells, or even to retrieve the cell in the original Object3D it belongs to.

Result

Ƭ 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

Ƭ 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

Ƭ VisualOptions: Object

The options for Intersection3DUtil.generateIntersectionVisuals() to generate the visual representation of the intersection result.

Type declaration

NameTypeDescription
colorprovidertouse?ColorProviderNameWhich 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?LineOptionsOptions for line segments created from Intersection3DUtil.Result.lines
overridecolorprovider?ColorProvider | RgbaColor | stringUse this colorprovider/color for the visual, instead of the intersected object's.
pointoptions?PointOptionsOptions for points created from Intersection3DUtil.Result.points
polygonoptions?PolygonOptionsOptions for polygons created from Intersection3DUtil.Result.polygons
valuestouse?ValueNameWhich 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

Ƭ VisualResult: Object

Result for visual object of intersection

Type declaration

NameTypeDescription
linesegmentsLineSegments | nullLineSegments to visualize intersection lines.
pointsetPointSet | nullPointSet to visualize intersection points.
surfaceSurface | nullSurface to visualize intersection polygons.