Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mesh utilities nodes #1271

Merged
merged 3 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions meshroom/nodes/aliceVision/ConvertMesh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
__version__ = "1.0"

from meshroom.core import desc


class ConvertMesh(desc.CommandLineNode):
commandLine = 'aliceVision_convertMesh {allParams}'
documentation = '''This node allows to convert a mesh to another format.'''

inputs = [
desc.File(
name='inputMesh',
label='Input Mesh',
description='Input Mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).',
value='',
uid=[0],
),
desc.ChoiceParam(
name='outputMeshFormat',
label='Output Mesh Format',
description='''Output Mesh Format (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).''',
value='obj',
values=['obj', 'mesh', 'meshb', 'ply', 'off','stl'],
exclusive=True,
uid=[0],
group='',
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
description='''verbosity level (fatal, error, warning, info, debug, trace).''',
value='info',
values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],
exclusive=True,
uid=[],
),
]

outputs = [
desc.File(
name='output',
label='Output Mesh',
description='''Output mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).''',
value=desc.Node.internalFolder + 'mesh.' + '{outputMeshFormatValue}',
uid=[],
),
]
75 changes: 75 additions & 0 deletions meshroom/nodes/aliceVision/MergeMeshes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
__version__ = "1.0"

from meshroom.core import desc


class MergeMeshes(desc.CommandLineNode):
commandLine = 'aliceVision_utils_mergeMeshes {allParams}'
documentation = '''
This node allows to merge two meshes in one.

Operation types used to merge two meshes:

- boolean_union: Create a new mesh with the combined volume of the two input meshes.
- boolean_intersection: Create a new mesh from the intersected volumes of the two input meshes.
- boolean_difference: Create a new mesh from the volume of the first input mesh subtracted by the second input mesh.
'''

inputs = [
desc.File(
name='inputFirstMesh',
label='Input First Mesh',
description='Input First Mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).',
value='',
uid=[0],
),
desc.File(
name='inputSecondMesh',
label='Input Second Mesh',
description='Input Second Mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).',
value='',
uid=[0],
),
desc.ChoiceParam(
name='mergeOperation',
label='Merge Operation',
description='''Operation types used to merge two meshes.''',
value='boolean_union',
values=['boolean_union', 'boolean_intersection', 'boolean_difference'],
exclusive=True,
uid=[0],
),
desc.BoolParam(
name='preProcess',
label='Pre-Process',
description='''Pre-process input meshes in order to avoid geometric errors in the merging process''',
value=True,
uid=[0],
),
desc.BoolParam(
name='postProcess',
label='Post-Process',
description='''Post-process output mesh in order to avoid future geometric errors.''',
value=True,
uid=[0],
),
desc.ChoiceParam(
name='verboseLevel',
label='Verbose Level',
description='''verbosity level (fatal, error, warning, info, debug, trace).''',
value='info',
values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'],
exclusive=True,
uid=[],
),
]

outputs = [
desc.File(
name='output',
label='Output mesh',
description='''Output mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).''',
value=desc.Node.internalFolder + 'mesh.stl',
uid=[],
),
]