Quotation
Description of the quotation
field¶
interface QuotationState {
quotations: Quotation[]
currentlyEditedQuotation: TemporaryQuotationData | undefined
focusedQuotationId: string | undefined
}
quotations
¶
Updated by: Player/UI
List of the Quotations of the current file.
Data model¶
interface Quotation {
colorId: number
display: QuotationDisplay
file: string
id: string
metric: 'distance' | 'angle' | 'curvature'
name: string
projection: { x: number; y: number; z: number }[]
quotationPoints: QuotationPoint[]
readPermissions: string[]
type: QuotationType
unit: QuotationUnit
writePermissions: string[]
}
enum QuotationDisplay {
DISTANCE = 'distance',
DISTANCE_AND_COMPONENT = 'distance-and-components',
ANGLE = 'angle',
ANGLE_AND_DIFFERENCE_TO_360 = 'angle-and-difference-to-360',
NOTHING = 'nothing',
RADIUS = 'radius',
DISTANCE_AND_RADIUS = 'distance-and-radius',
}
interface QuotationPoint {
measurePoint: {
x: number
y: number
z: number
}
pickingNormal: {
x: number
y: number
z: number
}
pickingPoint: {
node: string
position: {
x: number
y: number
z: number
}
ray: {
direction: {
x: number
y: number
z: number
}
origin: {
x: number
y: number
z: number
}
}
}
}
enum QuotationType {
POINT_POINT = 'point-point',
AXIS_AXIS = 'axis-axis',
AXIS_SURFACE = 'axis-surface',
SURFACE_SURFACE = 'surface-surface',
EVOLUTE = 'evolute',
}
enum QuotationUnit {
AUTO = 'auto',
MILLIMETERS = 'millimeters',
CENTIMETERS = 'centimeters',
METERS = 'meters',
DEGREES = 'degrees',
}
Examples¶
Delete all Quotations¶
Add one Quotation¶
{
...
"quotation": {
"quotations": [
{
"colorId": 0,
"display": "distance",
"file": "61f9208519bc49000dec2885",
"id": "61f94ecb71d1f5001178d274",
"metric": "distance",
"name": "Distance quotation 1",
"projection": [],
"quotationPoints": [
{
"measurePoint": {
"x": 2.9218225479125977,
"y": -0.22875404357910156,
"z": 6.11561393737793
},
"pickingNormal": {
"x": 0.944996178150177,
"y": 0.06559590995311737,
"z": 0.3204363286495209
},
"pickingPoint": {
"node": "61f9208694fae90010ed375b",
"position": {
"x": 2.9218225479125977,
"y": -0.22875404357910156,
"z": 6.11561393737793
},
"ray": {
"direction": {
"x": -0.6830883622169495,
"y": -0.5153371691703796,
"z": -0.5175111889839172
},
"origin": {
"x": 14.898283958435059,
"y": 8.806556701660156,
"z": 15.189041137695312
}
}
}
},
{
"measurePoint": {
"x": 1.0000019073486328,
"y": 0.0798187255859375,
"z": -1.9682331085205078
},
"pickingNormal": {
"x": 1,
"y": 1.649048613217019e-07,
"z": 5.960464477539063e-08
},
"pickingPoint": {
"node": "61f9208694fae90010ed3762",
"position": {
"x": 1.0000019073486328,
"y": 0.0798187255859375,
"z": -1.9682331085205078
},
"ray": {
"direction": {
"x": -0.5858922600746155,
"y": -0.3682507574558258,
"z": -0.7218875885009766
},
"origin": {
"x": 14.908649444580078,
"y": 8.821818351745605,
"z": 15.168842315673828
}
}
}
}
],
"readPermissions": [],
"type": "point-point",
"unit": "auto",
"writePermissions": []
}
]
}
...
}
Operations done by the Player¶
When a quotation is created or updated, the Player sets the quotationPoints
and the projection
fields of the quotation.
Here are examples of JSON Patches when the Player updates the fields quotationPoints
or projection
:
[
{
"op": "replace",
"path": "/quotation/quotations/0/quotationPoints",
"value": [
{
"measurePoint": {
"x": 2.9218225479125977,
"y": -0.22875404357910156,
"z": 6.11561393737793
},
"pickingNormal": {
"x": 0.944996178150177,
"y": 0.06559590995311737,
"z": 0.3204363286495209
},
"pickingPoint": {
"node": "61f9208694fae90010ed375b",
"position": {
"x": 2.9218225479125977,
"y": -0.22875404357910156,
"z": 6.11561393737793
},
"ray": {
"direction": {
"x": -0.6830883622169495,
"y": -0.5153371691703796,
"z": -0.5175111889839172
},
"origin": {
"x": 14.898283958435059,
"y": 8.806556701660156,
"z": 15.189041137695312
}
}
}
},
{
"measurePoint": {
"x": 1.0000019073486328,
"y": 0.0798187255859375,
"z": -1.9682331085205078
},
"pickingNormal": {
"x": 1,
"y": 1.649048613217019e-07,
"z": 5.960464477539063e-08
},
"pickingPoint": {
"node": "61f9208694fae90010ed3762",
"position": {
"x": 1.0000019073486328,
"y": 0.0798187255859375,
"z": -1.9682331085205078
},
"ray": {
"direction": {
"x": -0.5858922600746155,
"y": -0.3682507574558258,
"z": -0.7218875885009766
},
"origin": {
"x": 14.908649444580078,
"y": 8.821818351745605,
"z": 15.168842315673828
}
}
}
}
]
}
]
currentlyEditedQuotation
¶
Updated by: UI
Data of the temporary quotation representing the quotation being edited or created.
Data model¶
interface TemporaryQuotationData {
colorId: number
display: QuotationDisplay
metric: 'distance' | 'angle' | 'curvature'
name: string
projection: { x: number; y: number; z: number }[]
quotationPoints: QuotationPoint[]
type: QuotationType
unit: QuotationUnit
}
Examples¶
A Quotation is being edited¶
{
...
"quotation": {
"currentlyEditedQuotation": [
{
"colorId": 0,
"display": "distance",
"metric": "distance",
"name": "Distance quotation 1",
"projection": [],
"quotationPoints": [
{
"measurePoint": {
"x": 2.9218225479125977,
"y": -0.22875404357910156,
"z": 6.11561393737793
},
"pickingNormal": {
"x": 0.944996178150177,
"y": 0.06559590995311737,
"z": 0.3204363286495209
},
"pickingPoint": {
"node": "61f9208694fae90010ed375b",
"position": {
"x": 2.9218225479125977,
"y": -0.22875404357910156,
"z": 6.11561393737793
},
"ray": {
"direction": {
"x": -0.6830883622169495,
"y": -0.5153371691703796,
"z": -0.5175111889839172
},
"origin": {
"x": 14.898283958435059,
"y": 8.806556701660156,
"z": 15.189041137695312
}
}
}
},
{
"measurePoint": {
"x": 1.0000019073486328,
"y": 0.0798187255859375,
"z": -1.9682331085205078
},
"pickingNormal": {
"x": 1,
"y": 1.649048613217019e-07,
"z": 5.960464477539063e-08
},
"pickingPoint": {
"node": "61f9208694fae90010ed3762",
"position": {
"x": 1.0000019073486328,
"y": 0.0798187255859375,
"z": -1.9682331085205078
},
"ray": {
"direction": {
"x": -0.5858922600746155,
"y": -0.3682507574558258,
"z": -0.7218875885009766
},
"origin": {
"x": 14.908649444580078,
"y": 8.821818351745605,
"z": 15.168842315673828
}
}
}
}
],
"type": "point-point",
"unit": "auto",
}
]
}
...
}
focusedQuotationId
¶
Updated by: UI
ID of the Quotation the camera is focusing on.
Data model¶
Examples¶
Do not focus on any Quotation¶
{
...
"quotation": {
"quotations": [
{
...
"id": "61f94ecb71d1f5001178d274"
...
},
{
...
"id": "61f94ec01178d274b71d1f50"
...
}
],
"focusedQuotationId": ""
}
...
}
Focus on a Quotation¶
{
...
"quotation": {
"quotations": [
{
...
"id": "61f94ecb71d1f5001178d274"
...
}
],
"focusedQuotationId": "61f94ecb71d1f5001178d274"
}
...
}
November 24, 2022
March 8, 2022