-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGeolocationLidarLasToMesh.py
More file actions
80 lines (71 loc) · 2.56 KB
/
GeolocationLidarLasToMesh.py
File metadata and controls
80 lines (71 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
__version__ = "2.0"
import os
from pathlib import Path
from meshroom.core import desc
from meshroom.core.utils import VERBOSE_LEVEL
# from meshroom.core.plugin import EnvType
class GeolocationLidarLasToMesh(desc.CommandLineNode):
# Plugin Infos for the Plugin System
# envFile = os.path.join(os.path.dirname(__file__), '../requirements.txt')
# envType = EnvType.VENV
# On Windows, needs to avoid backslash for command line execution (as_posix needed)
currentFilePath = Path(__file__).absolute()
currentFileFolderPath = currentFilePath.parent
# Resolve venv Python if present, then MESHROOM_GEOLOC_PYTHON, then bare 'python'
_plugin_dir = (currentFileFolderPath / "../..").resolve()
_venv_python = next(
(p for p in [_plugin_dir / ".venv/Scripts/python.exe", _plugin_dir / ".venv/bin/python"] if p.exists()),
None
)
pythonPath = Path(os.environ.get("MESHROOM_GEOLOC_PYTHON", str(_venv_python) if _venv_python else "python"))
targetScriptPath = (currentFileFolderPath / "../../scripts/lidarLasToMesh.py").resolve()
commandLine = pythonPath.as_posix() +' -E '+ targetScriptPath.as_posix() +' {allParams}'
category = 'Geolocation'
documentation = '''
This node allows to generate a mesh from .asc and .las LIDAR file.
'''
inputs = [
desc.File(
name='folder',
label='Folder',
description='''Folder''',
value= "",
),
desc.File(
name='GPSFile',
label='GPS Coordinates',
description='''GPS coordinates''',
value= "",
),
desc.ChoiceParam(
name='MeshMethod',
label='Mesh method',
description='''Mesh Method (Voxel, Delaunay Triangulation).''',
value='voxel',
values=['voxel', 'delaunay'],
exclusive=True,
),
desc.IntParam(
name="dist",
label="Distance From Center (m)",
description="Distance from center point (m)",
value=200,
range=(50, 500, 1),
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
description='''verbosity level (critical, error, warning, info, debug).''',
value='info',
values=VERBOSE_LEVEL,
exclusive=True,
),
]
outputs = [
desc.File(
name='outputobj',
label='OBJ from File',
description='''OBJ from File''',
value='{nodeCacheFolder}/mesh.obj',
),
]