[nodes] Add nodes MeshDenoising and MeshDecimate

This commit is contained in:
Fabien Castan 2018-02-28 17:56:15 +01:00 committed by Yann Lanthony
parent c5d6b9b9e9
commit 36ed1a5236
2 changed files with 151 additions and 0 deletions

View file

@ -0,0 +1,67 @@
from meshroom.core import desc
class MeshDecimate(desc.CommandLineNode):
internalFolder = '{cache}/{nodeType}/{uid0}/'
commandLine = 'aliceVision_meshDecimate {allParams}'
cpu = desc.Level.NORMAL
ram = desc.Level.NORMAL
inputs = [
desc.File(
name="input",
label='Input Mesh (OBJ file format).',
description='',
value='',
uid=[0],
),
desc.FloatParam(
name='simplificationFactor',
label='Simplification factor',
description='Simplification factor',
value=0.5,
range=(0.0, 1.0, 0.01),
uid=[0],
),
desc.IntParam(
name='nbVertices',
label='Fixed Number of Vertices',
description='Fixed number of output vertices.',
value=0,
range=(0, 1000000, 1),
uid=[0],
),
desc.IntParam(
name='minVertices',
label='Min Vertices',
description='Min number of output vertices.',
value=0,
range=(0, 1000000, 1),
uid=[0],
),
desc.IntParam(
name='maxVertices',
label='Max Vertices',
description='Max number of output vertices.',
value=0,
range=(0, 1000000, 1),
uid=[0],
),
desc.BoolParam(
name='flipNormals',
label='Flip Normals',
description='''Option to flip face normals. It can be needed as it depends on the vertices order in triangles and the convention change from one software to another.''',
value=False,
uid=[0],
),
]
outputs = [
desc.File(
name="output",
label="Output mesh",
description="Output mesh (OBJ file format).",
value='{cache}/{nodeType}/{uid0}/mesh.obj',
uid=[],
),
]

View file

@ -0,0 +1,84 @@
import sys
from meshroom.core import desc
class MeshDenoising(desc.CommandLineNode):
internalFolder = '{cache}/{nodeType}/{uid0}/'
commandLine = 'aliceVision_meshDenoising {allParams}'
inputs = [
desc.File(
name='input',
label='Input',
description='''Input Mesh (OBJ file format).''',
value='',
uid=[0],
),
desc.IntParam(
name='denoisingIterations',
label='Denoising Iterations',
description='''Number of denoising iterations.''',
value=5,
range=(0, 30, 1),
uid=[0],
),
desc.FloatParam(
name='meshUpdateClosenessWeight',
label='Mesh Update Closeness Weight',
description='''Closeness weight for mesh update, must be positive.''',
value=0.001,
range=(0.0, 0.1, 0.001),
uid=[0],
),
desc.FloatParam(
name='lambda',
label='Lambda',
description='''Regularization weight.''',
value=2.0,
range=(0.0, 10.0, 1.0),
uid=[0],
),
desc.FloatParam(
name='eta',
label='Eta',
description='''Gaussian standard deviation for spatial weight, scaled by the average distance between adjacent face cetroids. Must be positive.''',
value=1.5,
range=(0.0, 20.0, 0.01),
uid=[0],
),
desc.FloatParam(
name='mu',
label='Mu',
description='''Gaussian standard deviation for guidance weight.''',
value=1.5,
range=(0.0, 10.0, 0.01),
uid=[0],
),
desc.FloatParam(
name='nu',
label='Nu',
description='''Gaussian standard deviation for signal weight.''',
value=0.3,
range=(0.0, 5.0, 0.01),
uid=[0],
),
desc.ChoiceParam(
name='meshUpdateMethod',
label='Mesh Update Method',
description='Mesh Update Method: * ITERATIVE_UPDATE(SDFilter::MeshFilter Parameters::ITERATIVE_UPDATE) (default): ShapeUp styled iterative solver * POISSON_UPDATE(SDFilter::MeshFilterPa rameters::POISSON_UPDATE): Poisson-based update from [Want et al. 2015]',
value=0,
values=(0, 1),
exclusive=True,
uid=[0],
),
]
outputs = [
desc.File(
name='output',
label='Output',
description='''Output mesh (OBJ file format).''',
value='{cache}/{nodeType}/{uid0}/mesh.obj',
uid=[],
),
]