Measure API
Measure.MeasureScene
Scene with objects being measured. Brep files are required
Methods​
areaFromPolygon​
â–¸ areaFromPolygon(vertices
, normals
): Object
Calculates the area from polygon. Treat polygon as closed. y is treated as height and is ignored.
Parameters​
Name | Type |
---|---|
vertices | ReadonlyVec3 [] |
normals | ReadonlyVec3 [] |
Returns​
Object
Name | Type |
---|---|
area | number |
polygon | ReadonlyVec3 [] |
collision​
â–¸ collision(a
, b
, setting?
): Promise
<CollisionValues
>
Returns collision values between 2 entities currently only works for two cylinders
Parameters​
Name | Type |
---|---|
a | SelectedEntity |
b | SelectedEntity |
setting? | MeasureSettings |
Returns​
Promise
<CollisionValues
>
followParametricObjectFromPosition​
â–¸ followParametricObjectFromPosition(id
, selectionPosition
, setting?
): Promise
<FollowParametricObject
>
Returns an object that can be used to calculate camera posisiotns that follow the object Supports Edges, curve segments and cylinder
Parameters​
Name | Type |
---|---|
id | ObjectId |
selectionPosition | ReadonlyVec3 |
setting? | MeasureSettings |
Returns​
Promise
<FollowParametricObject
>
followParametricObjects​
â–¸ followParametricObjects(ids
, setting?
): Promise
<FollowParametricObject
>
Returns an object that can be used to calculate camera posisiotns that follow the objects Supports multiple cylinder, In case of one object, and that object only containing one curve segment it will return curve segment
Parameters​
Name | Type |
---|---|
ids | ObjectId [] |
setting? | MeasureSettings |
Returns​
Promise
<FollowParametricObject
>
getCameraValues​
â–¸ getCameraValues(a
, cameraDir
): Promise
<CameraValues
>
Get suggested camea values for selected object For cylinder values snap to the closest axis on the cylinder
Parameters​
Name | Type |
---|---|
a | MeasureEntity |
cameraDir | vec3 |
Returns​
Promise
<CameraValues
>
getCrossSections​
â–¸ getCrossSections(roadIds
, profileNumber
): Promise
<RoadCrossSection
[]>
Parameters​
Name | Type |
---|---|
roadIds | string [] |
profileNumber | number |
Returns​
Promise
<RoadCrossSection
[]>
getCrossSlope​
â–¸ getCrossSlope(roadId
): Promise
<CrossSlope
>
Parameters​
Name | Type |
---|---|
roadId | string |
Returns​
Promise
<CrossSlope
>
getParametricProduct​
â–¸ getParametricProduct(id
): Promise
<any
>
Returns the entire parametric hierarchy, returns undefined upon abort
Parameters​
Name | Type |
---|---|
id | ObjectId |
Returns​
Promise
<any
>
getProfileViewFromEntity​
â–¸ getProfileViewFromEntity(entity
, setting?
): Promise
<Profile
>
Returns the profile view of a linestrip where x is the length of the line and y is the height
Parameters​
Name | Type |
---|---|
entity | MeasureEntity |
setting? | MeasureSettings |
Returns​
Promise
<Profile
>
getProfileViewFromMultiSelect​
â–¸ getProfileViewFromMultiSelect(ids
, setting?
): Promise
<Profile
>
Returns the profile view of selected objects where x is the length of the line and y is the height, currently only supports cylinders
Parameters​
Name | Type |
---|---|
ids | ObjectId [] |
setting? | MeasureSettings |
Returns​
Promise
<Profile
>
getRoadProfile​
â–¸ getRoadProfile(roadId
): Promise
<RoadProfiles
>
Parameters​
Name | Type |
---|---|
roadId | string |
Returns​
Promise
<RoadProfiles
>
inspectObject​
â–¸ inspectObject(productId
, objectType
): Promise
<ManholeMeasureValues
>
Object inspection, where the entire parametric object is treated as the input object type
Parameters​
Name | Type |
---|---|
productId | number |
objectType | "manhole" |
Returns​
Promise
<ManholeMeasureValues
>
measure​
â–¸ measure(a
, b?
, settingA?
, settingB?
): Promise
<MeasurementValues
>
Measure objet, if b is undefined then single measure values are returned else the measurement between 2 objects
Parameters​
Name | Type |
---|---|
a | MeasureEntity |
b? | MeasureEntity |
settingA? | MeasureSettings |
settingB? | MeasureSettings |
Returns​
Promise
<MeasurementValues
>
measureLineStrip​
â–¸ measureLineStrip(vertices
): LineStripMeasureValues
Measure between multiple points.
Parameters​
Name | Type |
---|---|
vertices | ReadonlyVec3 [] |
Returns​
measureToPoint​
â–¸ measureToPoint(a
, b
, setting?
): Promise
<DuoMeasurementValues
>
Measure distance between a measurement object an a 3d point
Parameters​
Name | Type |
---|---|
a | MeasureEntity |
b | ReadonlyVec3 |
setting? | MeasureSettings |
Returns​
Promise
<DuoMeasurementValues
>
pickMeasureEntity​
â–¸ pickMeasureEntity(id
, selectionPosition
, tolerance?
): Promise
<{ connectionPoint?
: vec3
; entity
: MeasureEntity
; status
: BrepStatus
}>
Returns the measure entity for given object and location*
Parameters​
Name | Type |
---|---|
id | ObjectId |
selectionPosition | ReadonlyVec3 |
tolerance? | SnapTolerance |
Returns​
Promise
<{ connectionPoint?
: vec3
; entity
: MeasureEntity
; status
: BrepStatus
}>
pickMeasureEntityOnCurrentObject​
â–¸ pickMeasureEntityOnCurrentObject(id
, selectionPosition
, tolerance
): Promise
<{ connectionPoint?
: vec3
; entity
: MeasureEntity
; status
: BrepStatus
}>
Returns the measure entity for given object and location if the current object is selected This is much faster than pickMeasureEntity and can be used for hover*
Parameters​
Name | Type |
---|---|
id | ObjectId |
selectionPosition | ReadonlyVec3 |
tolerance | SnapTolerance |
Returns​
Promise
<{ connectionPoint?
: vec3
; entity
: MeasureEntity
; status
: BrepStatus
}>
pointToPoint​
â–¸ pointToPoint(a
, b
): DuoMeasurementValues
Measure distance between 2 points
Parameters​
Name | Type |
---|---|
a | ReadonlyVec3 |
b | ReadonlyVec3 |
Returns​
reverseProfile​
â–¸ reverseProfile(inProfile
): Profile
Return reveresed input profile
Parameters​
Name | Type |
---|---|
inProfile | Profile |
Returns​
swapCylinder​
â–¸ swapCylinder(entity
, to
): Promise
<MeasureEntity
>
Swaps between inner and outer cylinder, returns undefined if there is only one
Parameters​
Name | Type |
---|---|
entity | MeasureEntity |
to | "inner" | "outer" |
Returns​
Promise
<MeasureEntity
>