FlatPatternComponent.findMeshUsingRay Method

Parent Object: FlatPatternComponent
Defined in namespace "adsk::fusion" and the header file is <Fusion/SheetMetal/FlatPatternComponent.h>

Description

Finds all mesh bodies that are intersected by the specified ray.

Syntax

"flatPatternComponent_var" is a variable referencing a FlatPatternComponent object.

# Uses no optional arguments.
(returnValue, hitPoints) = flatPatternComponent_var.findMeshUsingRay(originPoint, rayDirection)

# Uses optional arguments.
(returnValue, hitPoints) = flatPatternComponent_var.findMeshUsingRay(originPoint, rayDirection, visibleEntitiesOnly)

#include <Fusion/SheetMetal/FlatPatternComponent.h

// Uses no optional arguments.
// Declare the output arguments.
Ptr<Point3D> originPoint;
Ptr<Vector3D> rayDirection;
Point3D[] hitPoints;
Ptr<MeshBody> returnValue = flatPatternComponent_var->findMeshUsingRay(originPoint, rayDirection, hitPoints);

// Uses optional arguments.
// Declare the output arguments.
boolean visibleEntitiesOnly;

// Call the function.
Ptr<FlatPatternComponent> returnValue = flatPatternComponent_var->findMeshUsingRay(originPoint, rayDirection, hitPoints, visibleEntitiesOnly);

Return Value

Type Description
MeshBody[] Returns an array containing the mesh bodies found. The returned array can be empty indicating nothing was found. The points are returned in an order where they are arranged based on their distance from the origin point where the closest point is first. If an mesh body is hit more than once, the entity is returned once for the first intersection.

Parameters

Name Type Description
originPoint Point3D Input point that defines the origin of the ray. The search for entities begins at this point.
rayDirection Vector3D Input vector that defines the direction of the ray. The ray is infinite so the length of the vector is ignored.
hitPoints Point3D[] The output array of points that represent the coordinates where the ray hit the found entity. There will be the same number of hit points as returned entities. In other words, hit point 1 corresponds with found entity 1, hit point 2 corresponds with found entity 2, and so on.
visibleEntitiesOnly boolean Optional argument that indicates whether or not invisible entities should be included in the search. Defaults to True indicating that invisible entities will be ignored.

This is an optional argument whose default value is True.

Version

Introduced in version May 2026