Skip to content

Commit a3cbf0b

Browse files
committed
Upgading to Schema 10
1 parent 2c2ab70 commit a3cbf0b

25 files changed

+849
-27
lines changed

.vscode/launch.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@
4646
"console": "integratedTerminal",
4747
"cwd": "${workspaceFolder}",
4848
"justMyCode": true
49+
},
50+
{
51+
"name": "Python: Build Proto Script",
52+
"type": "debugpy",
53+
"request": "launch",
54+
"program": "${workspaceFolder}/scripts/build_proto.py",
55+
"console": "integratedTerminal",
56+
"cwd": "${workspaceFolder}",
57+
"justMyCode": true
4958
}
5059
]
5160
}

scripts/transpileProto.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
"google.protobuf.Any": "_any_pb2"
3030
}
3131

32+
methods_rename = {
33+
"import" : "import_file"
34+
}
35+
3236
python_types = [
3337
"int",
3438
"float",
@@ -512,7 +516,9 @@ def generate_service_code( current_node:TreeNode, tree:Tree) -> str:
512516
if c.isupper() and i != 0:
513517
method_name += "_"
514518
method_name += c.lower()
515-
519+
# Replace method_name if it matches any key in defenitions_rename
520+
method_name = methods_rename.get(method_name, method_name)
521+
516522
# loop over all the properties from the request node to get the input node
517523

518524
method_properties = []

three/MF/V3/Descriptors/HeatMap.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
class HeatMap:
2+
3+
"""
4+
Heat map descriptor.
5+
"""
6+
def __init__(self, count: int, min: float, max: float, median: float, mean: float, stddev: float, outlierDistance: float):
7+
# The of points included in the point-to-mesh statistics.
8+
self.count = count
9+
# The minimum point-to-mesh distance.
10+
self.min = min
11+
# The maximum point-to-mesh distance.
12+
self.max = max
13+
# The median point-to-mesh distance.
14+
self.median = median
15+
# The mean point-to-mesh distance.
16+
self.mean = mean
17+
# The standard deviation of the point-to-mesh distances.
18+
self.stddev = stddev
19+
# The point-to-mesh outlier distance. Distances greater than this value are excluded from the statistics.
20+
self.outlierDistance = outlierDistance
21+
22+

three/MF/V3/Descriptors/Import.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
from MF.V3.Descriptors.Project import Project as MF_V3_Descriptors_Project_Project
2+
from enum import Enum
3+
from typing import List
4+
5+
6+
class Import:
7+
8+
"""
9+
Import scan descriptor.
10+
"""
11+
class Error(Enum):
12+
13+
"""
14+
Import error codes.
15+
"""
16+
Unspecified = "Unspecified" # The error is unspecified.
17+
FileNotSupported = "FileNotSupported" # The file format is not supported.
18+
CannotReadFile = "CannotReadFile" # The file format is supported but cannot be read.
19+
MeshIsEmpty = "MeshIsEmpty" # The imported mesh has no faces.
20+
NotEnoughStorage = "NotEnoughStorage" # There is not enough filesystem memory to store the mesh.
21+
22+
class Imported:
23+
24+
"""
25+
A file that was successfully imported to the project.
26+
"""
27+
def __init__(self, file: str):
28+
# The file name.
29+
self.file = file
30+
31+
class Ignored:
32+
33+
"""
34+
A file that failed to be imported to the project.
35+
"""
36+
def __init__(self, file: str, error: 'Import.Error'):
37+
# The file name.
38+
self.file = file
39+
# The import error code.
40+
self.error = error
41+
42+
def __init__(self, groups: MF_V3_Descriptors_Project_Project.Group, imported: List['Imported'] = None, ignored: List['Ignored'] = None):
43+
# The updated project group tree.
44+
self.groups = groups
45+
# The list of successfully imported files.
46+
self.imported = imported
47+
# The list of ignored files.
48+
self.ignored = ignored
49+
50+

three/MF/V3/Descriptors/ScanData.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Type(Enum):
2626
Normal = "Normal" # Vertex normal.
2727
Color = "Color" # Vertex color.
2828
UV = "UV" # Vertex texture coordinate.
29+
Quality = "Quality" # Vertex quality.
2930
Triangle = "Triangle" # Triangle index.
3031
Texture = "Texture" # Texture.
3132

three/MF/V3/Descriptors/Settings/Advanced.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,38 @@ def __init__(self, value: int, default: int, min: int, max: int):
297297
self.min = min
298298
self.max = max
299299

300-
def __init__(self, rampAngle: 'RampAngle'):
300+
class PointClippingRadius:
301+
def __init__(self, value: float, default: float, min: float, max: float):
302+
self.value = value
303+
self.default = default
304+
self.min = min
305+
self.max = max
306+
307+
class PointClippingMinHeight:
308+
def __init__(self, value: float, default: float, min: float, max: float):
309+
self.value = value
310+
self.default = default
311+
self.min = min
312+
self.max = max
313+
314+
class PointClippingMaxHeight:
315+
def __init__(self, value: float, default: float, min: float, max: float):
316+
self.value = value
317+
self.default = default
318+
self.min = min
319+
self.max = max
320+
321+
def __init__(self, use: 'Advanced.Use', rampAngle: 'RampAngle', pointClippingRadius: 'PointClippingRadius', pointClippingMinHeight: 'PointClippingMinHeight', pointClippingMaxHeight: 'PointClippingMaxHeight'):
322+
# Use the advanced turntable settings.
323+
self.use = use
301324
# The angle in degrees to slow down the turntable at the end of a rotation.
302325
self.rampAngle = rampAngle
326+
# The radius of the point clipping cylinder.
327+
self.pointClippingRadius = pointClippingRadius
328+
# The minimum height of the point clipping cylinder.
329+
self.pointClippingMinHeight = pointClippingMinHeight
330+
# The maximum height of the point clipping cylinder.
331+
self.pointClippingMaxHeight = pointClippingMaxHeight
303332

304333
def __init__(self, capture: 'Capture', sampling: 'Sampling', edgeDetection: 'EdgeDetection', phaseFilter: 'PhaseFilter', adaptiveSampling: 'AdaptiveSampling', normalEstimation: 'NormalEstimation', outlierRemoval: 'OutlierRemoval', remesh: 'Remesh', camera: 'Camera', turntable: 'Turntable'):
305334
# Capture settings descriptor.

three/MF/V3/Descriptors/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from MF.V3.Descriptors.BoundingBox import *
22
from MF.V3.Descriptors.CaptureImage import *
33
from MF.V3.Descriptors.Export import *
4+
from MF.V3.Descriptors.HeatMap import *
45
from MF.V3.Descriptors.Image import *
6+
from MF.V3.Descriptors.Import import *
57
from MF.V3.Descriptors.Merge import *
68
from MF.V3.Descriptors.Project import *
79
from MF.V3.Descriptors.ProjectActions import *

three/MF/V3/Settings/Advanced.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,17 @@ class Turntable:
189189
"""
190190
Turntable settings.
191191
"""
192-
def __init__(self, rampAngle: int = None):
192+
def __init__(self, rampAngle: int = None, pointClippingRadius: float = None, pointClippingMinHeight: float = None, pointClippingMaxHeight: float = None, use: bool = None):
193193
# The angle in degrees to slow down the turntable at the end of a rotation.
194194
self.rampAngle = rampAngle
195+
# The radius of the point clipping cylinder.
196+
self.pointClippingRadius = pointClippingRadius
197+
# The minimum height of the point clipping cylinder.
198+
self.pointClippingMinHeight = pointClippingMinHeight
199+
# The maximum height of the point clipping cylinder.
200+
self.pointClippingMaxHeight = pointClippingMaxHeight
201+
# Use the turntable settings.
202+
self.use = use
195203

196204
def __init__(self, capture: 'Capture' = None, sampling: 'Sampling' = None, edgeDetection: 'EdgeDetection' = None, phaseFilter: 'PhaseFilter' = None, adaptiveSampling: 'AdaptiveSampling' = None, normalEstimation: 'NormalEstimation' = None, outlierRemoval: 'OutlierRemoval' = None, remesh: 'Remesh' = None, camera: 'Camera' = None, turntable: 'Turntable' = None):
197205
# Capture settings.
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
from typing import List
22

33

4-
class CopyGroup:
4+
class CopyGroups:
55

66
"""
7-
Copy scan group settings.
7+
Copy scan groups settings.
88
"""
9-
def __init__(self, sourceIndexes: List[int] = None, targetIndex: int = None, childPosition: int = None, nameSuffix: str = None):
9+
def __init__(self, sourceIndexes: List[int] = None, targetIndex: int = None, childPosition: int = None, nameSuffix: str = None, enumerate: bool = None):
1010
# The indexes of the groups to copy.
1111
self.sourceIndexes = sourceIndexes
1212
"""
13-
The index of the group into which the source group are copied.
14-
If unspecified the copied groups are added to the root of the group tree.
13+
The index of the group into which the source groups are copied.
14+
If unspecified the copied groups are inserted after their respective source groups within the same parent group.
1515
"""
1616
self.targetIndex = targetIndex
1717
"""
1818
The position among the target group's children where the copied groups are inserted.
1919
If unspecified the copied groups are appended to the end of the target group's children.
20+
Ignored if the targetIndex is unspecified or specified but does not exist.
2021
"""
2122
self.childPosition = childPosition
2223
"""
2324
Optional name suffix to append to the copied group names.
24-
If unspecified the names are unchanged.
25+
If unspecified the copied group names are unchanged.
2526
"""
2627
self.nameSuffix = nameSuffix
28+
"""
29+
Append a copy index the copied group names. e.g. ("name-2", "name-3"). Default is true.
30+
If a name suffix is specified then the first copy of each source group is not enumerated,
31+
but subsequent copies are.
32+
"""
33+
self.enumerate = enumerate
2734

2835

0 commit comments

Comments
 (0)