2025-12-01
This commit is contained in:
@@ -0,0 +1,150 @@
|
||||
import platform
|
||||
from ctypes import *
|
||||
from os import path
|
||||
from .data import Parameters, QRParameters, create_string, create_default_QRParameters
|
||||
|
||||
ilp_methods = {
|
||||
"LEASTSQUARES": 1,
|
||||
"ABS": 2,
|
||||
}
|
||||
|
||||
flow_config_files = {
|
||||
"SIMPLE": "config/main_config/flow_virtual_simple.json",
|
||||
"HALF": "config/main_config/flow_virtual_half.json",
|
||||
}
|
||||
|
||||
satsuma_config_files = {
|
||||
"DEFAULT": "config/satsuma/default.json",
|
||||
"MST": "config/satsuma/approx-mst.json",
|
||||
"ROUND2EVEN": "config/satsuma/approx-round2even.json",
|
||||
"SYMMDC": "config/satsuma/approx-symmdc.json",
|
||||
"EDGETHRU": "config/satsuma/edgethru.json",
|
||||
"LEMON": "config/satsuma/lemon.json",
|
||||
"NODETHRU": "config/satsuma/nodethru.json",
|
||||
}
|
||||
|
||||
class QWException(Exception):
|
||||
pass
|
||||
|
||||
class Quadwild():
|
||||
def __init__(self, mesh_path: str) -> None:
|
||||
if mesh_path is None or len(mesh_path) == 0:
|
||||
raise QWException("mesh_path is empty")
|
||||
|
||||
system = platform.system()
|
||||
if system == "Windows":
|
||||
quadwild_lib_filename = 'lib_quadwild.dll'
|
||||
quadpatches_lib_filename = 'lib_quadpatches.dll'
|
||||
elif system == "Darwin":
|
||||
quadwild_lib_filename = 'liblib_quadwild.dylib'
|
||||
quadpatches_lib_filename = 'liblib_quadpatches.dylib'
|
||||
else:
|
||||
quadwild_lib_filename = 'liblib_quadwild.so'
|
||||
quadpatches_lib_filename = 'liblib_quadpatches.so'
|
||||
|
||||
quadwild_lib_path = path.join(path.dirname(path.abspath(__file__)), quadwild_lib_filename)
|
||||
quadpatches_lib_path = path.join(path.dirname(path.abspath(__file__)), quadpatches_lib_filename)
|
||||
|
||||
self.quadwild = cdll.LoadLibrary(quadwild_lib_path)
|
||||
self.quadpatches = cdll.LoadLibrary(quadpatches_lib_path)
|
||||
|
||||
self.quadwild.remeshAndField2.argtypes = [POINTER(Parameters), c_char_p, c_char_p, c_char_p]
|
||||
self.quadwild.remeshAndField2.restype = None
|
||||
|
||||
self.quadwild.trace2.argtypes = [c_char_p]
|
||||
self.quadwild.trace2.restype = c_bool
|
||||
|
||||
self.quadpatches.quadPatches.argtypes = [c_char_p, POINTER(QRParameters), c_float, c_int, c_bool]
|
||||
self.quadpatches.quadPatches.restype = c_int
|
||||
|
||||
self.mesh_path = mesh_path
|
||||
self.mesh_path_without_ext, _ = path.splitext(mesh_path)
|
||||
self.sharp_path = f'{self.mesh_path_without_ext}_rem.sharp'
|
||||
self.field_path = f'{self.mesh_path_without_ext}_rem.rosy'
|
||||
self.remeshed_path = f'{self.mesh_path_without_ext}_rem.obj'
|
||||
self.traced_path = f'{self.mesh_path_without_ext}_rem_p0.obj'
|
||||
self.output_path = f'{self.mesh_path_without_ext}_rem_p0_0_quadrangulation.obj'
|
||||
self.output_smoothed_path = f'{self.mesh_path_without_ext}_rem_p0_0_quadrangulation_smooth.obj'
|
||||
|
||||
|
||||
def remeshAndField(self, remesh: bool, enableSharp: bool, sharpAngle: float) -> None:
|
||||
params = Parameters(
|
||||
remesh=remesh,
|
||||
sharpAngle=sharpAngle if enableSharp else -1,
|
||||
hasFeature=enableSharp,
|
||||
hasField=False,
|
||||
alpha=0.01, # Unused
|
||||
scaleFact=1, # Unused
|
||||
)
|
||||
mesh_filename_c = create_string(self.mesh_path)
|
||||
sharp_filename_c = create_string(self.sharp_path)
|
||||
field_filename_c = create_string(self.field_path)
|
||||
try:
|
||||
self.quadwild.remeshAndField2(byref(params), mesh_filename_c, sharp_filename_c, field_filename_c)
|
||||
except Exception as e:
|
||||
raise QWException("remeshAndField failed") from e
|
||||
|
||||
def trace(self) -> bool:
|
||||
remeshed_path_without_ext, _ = path.splitext(self.remeshed_path)
|
||||
filename_prefix_c = create_string(remeshed_path_without_ext)
|
||||
try:
|
||||
return self.quadwild.trace2(filename_prefix_c)
|
||||
except Exception as e:
|
||||
raise QWException("trace failed") from e
|
||||
|
||||
def quadrangulate(
|
||||
self,
|
||||
enableSmoothing: bool,
|
||||
scaleFact: float,
|
||||
fixedChartClusters: int,
|
||||
alpha: float,
|
||||
ilpMethod: str,
|
||||
timeLimit: int,
|
||||
gapLimit: float,
|
||||
minimumGap: float,
|
||||
isometry: bool,
|
||||
regularityQuadrilaterals: bool,
|
||||
regularityNonQuadrilaterals: bool,
|
||||
regularityNonQuadrilateralsWeight: float,
|
||||
alignSingularities: bool,
|
||||
alignSingularitiesWeight: float,
|
||||
repeatLosingConstraintsIterations: bool,
|
||||
repeatLosingConstraintsQuads: bool,
|
||||
repeatLosingConstraintsNonQuads: bool,
|
||||
repeatLosingConstraintsAlign: bool,
|
||||
hardParityConstraint: bool,
|
||||
flowConfig: str,
|
||||
satsumaConfig: str,
|
||||
callbackTimeLimit: list[float],
|
||||
callbackGapLimit: list[float],
|
||||
) -> int:
|
||||
params = create_default_QRParameters()
|
||||
|
||||
params.alpha = alpha
|
||||
params.ilpMethod = ilp_methods[ilpMethod]
|
||||
params.timeLimit = timeLimit
|
||||
params.gapLimit = gapLimit
|
||||
params.minimumGap = minimumGap
|
||||
params.isometry = isometry
|
||||
params.regularityQuadrilaterals = regularityQuadrilaterals
|
||||
params.regularityNonQuadrilaterals = regularityNonQuadrilaterals
|
||||
params.regularityNonQuadrilateralsWeight = regularityNonQuadrilateralsWeight
|
||||
params.alignSingularities = alignSingularities
|
||||
params.alignSingularitiesWeight = alignSingularitiesWeight
|
||||
params.repeatLosingConstraintsIterations = repeatLosingConstraintsIterations
|
||||
params.repeatLosingConstraintsQuads = repeatLosingConstraintsQuads
|
||||
params.repeatLosingConstraintsNonQuads = repeatLosingConstraintsNonQuads
|
||||
params.repeatLosingConstraintsAlign = repeatLosingConstraintsAlign
|
||||
params.hardParityConstraint = hardParityConstraint
|
||||
|
||||
params.flow_config_filename = path.join(path.dirname(path.abspath(__file__)), flow_config_files[flowConfig]).encode()
|
||||
params.satsuma_config_filename = path.join(path.dirname(path.abspath(__file__)), satsuma_config_files[satsumaConfig]).encode()
|
||||
|
||||
params.callbackTimeLimit = (c_float * len(callbackTimeLimit))(*callbackTimeLimit)
|
||||
params.callbackGapLimit = (c_float * len(callbackGapLimit))(*callbackGapLimit)
|
||||
|
||||
mesh_path_c = self.traced_path.encode()
|
||||
try:
|
||||
return self.quadpatches.quadPatches(mesh_path_c, byref(params), scaleFact, fixedChartClusters, enableSmoothing)
|
||||
except Exception as e:
|
||||
raise QWException("quadPatches failed") from e
|
||||
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 1
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 1
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_simple.json"
|
||||
satsuma_config_filename "config/satsuma/default.json"
|
||||
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_simple.json"
|
||||
satsuma_config_filename "config/satsuma/default.json"
|
||||
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_simple.json"
|
||||
satsuma_config_filename "config/satsuma/approx-mst.json"
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_simple.json"
|
||||
satsuma_config_filename "config/satsuma/approx-round2even.json"
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_simple.json"
|
||||
satsuma_config_filename "config/satsuma/approx-symmdc.json"
|
||||
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_simple.json"
|
||||
satsuma_config_filename "config/satsuma/edgethru.json"
|
||||
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_simple.json"
|
||||
satsuma_config_filename "config/satsuma/lemon.json"
|
||||
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_simple.json"
|
||||
satsuma_config_filename "config/satsuma/nodethru.json"
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"paired_half_target": "half",
|
||||
"paired_resolve_new_targets": false,
|
||||
"paired_initial": {
|
||||
"iso_weight": 0.5,
|
||||
"iso_objective": "abs",
|
||||
"unalign_weight": 1.0
|
||||
},
|
||||
"paired_resolve": {
|
||||
"iso_weight": 0.5,
|
||||
"iso_objective": "abs",
|
||||
"unalign_weight": 1.0
|
||||
},
|
||||
"paired_iso_weight": 0.5,
|
||||
"paired_iso_weight_resolve": 0.5
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 0.0
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 1
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 1
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 1
|
||||
flow_config_filename "config/main_config/flow_virtual_half.json"
|
||||
satsuma_config_filename "config/satsuma/default.json"
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"paired_half_target": "simple",
|
||||
"paired_resolve_new_targets": true,
|
||||
"paired_initial": {
|
||||
"iso_weight": 1,
|
||||
"iso_objective": "quad",
|
||||
"unalign_weight": 2.0
|
||||
},
|
||||
"paired_resolve": {
|
||||
"iso_weight": 1,
|
||||
"iso_objective": "abs",
|
||||
"unalign_weight": 4.0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 1.1e-9
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 1
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 1
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 300
|
||||
useFlowSolver 0
|
||||
@@ -0,0 +1,21 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 200
|
||||
gapLimit 1.1e-9
|
||||
callbackTimeLimit 8 3.00 5.000 10.0 20.0 30.0 60.0 90.0 120.0
|
||||
callbackGapLimit 8 0.005 0.02 0.05 0.10 0.15 0.20 0.25 0.3
|
||||
minimumGap 0.4
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 300
|
||||
useFlowSolver 0
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
alpha 0.005
|
||||
ilpMethod 1
|
||||
timeLimit 86400
|
||||
gapLimit 1.1e-9
|
||||
callbackTimeLimit 0
|
||||
callbackGapLimit 0
|
||||
minimumGap 100
|
||||
isometry 1
|
||||
regularityQuadrilaterals 1
|
||||
regularityNonQuadrilaterals 1
|
||||
regularityNonQuadrilateralsWeight 0.9
|
||||
alignSingularities 0
|
||||
alignSingularitiesWeight 0.1
|
||||
repeatLosingConstraintsIterations 1
|
||||
repeatLosingConstraintsQuads 0
|
||||
repeatLosingConstraintsNonQuads 0
|
||||
repeatLosingConstraintsAlign 0
|
||||
hardParityConstraint 1
|
||||
scaleFact 1
|
||||
fixedChartClusters 0
|
||||
useFlowSolver 0
|
||||
@@ -0,0 +1,4 @@
|
||||
do_remesh 1
|
||||
sharp_feature_thr 35
|
||||
alpha 0.01
|
||||
scaleFact 1
|
||||
@@ -0,0 +1,4 @@
|
||||
do_remesh 1
|
||||
sharp_feature_thr 35
|
||||
alpha 0.01
|
||||
scaleFact 1
|
||||
@@ -0,0 +1,4 @@
|
||||
do_remesh 1
|
||||
sharp_feature_thr -1
|
||||
alpha 0.02
|
||||
scaleFact 1
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"double_cover": {
|
||||
"max_deviation": 5,
|
||||
"matching_solver": "Lemon",
|
||||
"evening_mode": "MST",
|
||||
"method": "HalfAsymmetric",
|
||||
"verbosity": 1
|
||||
},
|
||||
"refine_with_matching": false,
|
||||
"matching_solver": "Lemon",
|
||||
"refinement_maxdev_min": 2,
|
||||
"refinement_maxdev_max": 2,
|
||||
"deviation_limit": "NodeThroughflow",
|
||||
"verbosity": 2
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"double_cover": {
|
||||
"max_deviation": 5,
|
||||
"matching_solver": "Lemon",
|
||||
"evening_mode": "RoundToEven",
|
||||
"method": "HalfAsymmetric",
|
||||
"verbosity": 1
|
||||
},
|
||||
"refine_with_matching": false,
|
||||
"matching_solver": "Lemon",
|
||||
"refinement_maxdev_min": 2,
|
||||
"refinement_maxdev_max": 2,
|
||||
"deviation_limit": "NodeThroughflow",
|
||||
"verbosity": 2
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"double_cover": {
|
||||
"max_deviation": 5,
|
||||
"matching_solver": "Lemon",
|
||||
"evening_mode": "MST",
|
||||
"method": "HalfSymmetric",
|
||||
"verbosity": 1
|
||||
},
|
||||
"refine_with_matching": false,
|
||||
"matching_solver": "Lemon",
|
||||
"refinement_maxdev_min": 2,
|
||||
"refinement_maxdev_max": 2,
|
||||
"deviation_limit": "NodeThroughflow",
|
||||
"verbosity": 2
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"double_cover": {
|
||||
"max_deviation": 5,
|
||||
"matching_solver": "Lemon",
|
||||
"evening_mode": "MST",
|
||||
"method": "HalfAsymmetric",
|
||||
"verbosity": 1
|
||||
},
|
||||
"refine_with_matching": true,
|
||||
"matching_solver": "lemon",
|
||||
"refinement_maxdev_min": 2,
|
||||
"refinement_maxdev_max": 2,
|
||||
"deviation_limit": "NodeThroughflow",
|
||||
"verbosity": 2
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"double_cover": {
|
||||
"max_deviation": 5,
|
||||
"matching_solver": "Lemon",
|
||||
"evening_mode": "MST",
|
||||
"method": "HalfAsymmetric",
|
||||
"verbosity": 1
|
||||
},
|
||||
"refine_with_matching": true,
|
||||
"matching_solver": "Lemon",
|
||||
"refinement_maxdev_min": 2,
|
||||
"refinement_maxdev_max": 2,
|
||||
"deviation_limit": "NodeThroughflow",
|
||||
"verbosity": 2
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"double_cover": {
|
||||
"max_deviation": 5,
|
||||
"matching_solver": "Lemon",
|
||||
"evening_mode": "MST",
|
||||
"method": "HalfAsymmetric",
|
||||
"verbosity": 1
|
||||
},
|
||||
"refine_with_matching": true,
|
||||
"matching_solver": "Lemon",
|
||||
"refinement_maxdev_min": 2,
|
||||
"refinement_maxdev_max": 2,
|
||||
"deviation_limit": "EdgeFlow",
|
||||
"verbosity": 2
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"double_cover": {
|
||||
"max_deviation": 5,
|
||||
"matching_solver": "Lemon",
|
||||
"evening_mode": "MST",
|
||||
"method": "HalfAsymmetric",
|
||||
"verbosity": 1
|
||||
},
|
||||
"refine_with_matching": true,
|
||||
"matching_solver": "Lemon",
|
||||
"refinement_maxdev_min": 2,
|
||||
"refinement_maxdev_max": 2,
|
||||
"deviation_limit": "NodeThroughflow",
|
||||
"verbosity": 2
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"double_cover": {
|
||||
"max_deviation": 5,
|
||||
"matching_solver": "Lemon",
|
||||
"evening_mode": "MST",
|
||||
"method": "HalfAsymmetric",
|
||||
"verbosity": 1
|
||||
},
|
||||
"refine_with_matching": true,
|
||||
"matching_solver": "Lemon",
|
||||
"refinement_maxdev_min": 2,
|
||||
"refinement_maxdev_max": 2,
|
||||
"deviation_limit": "NodeThroughflow",
|
||||
"verbosity": 2
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
from ctypes import *
|
||||
|
||||
class Parameters(Structure):
|
||||
_fields_ = [
|
||||
('remesh', c_bool),
|
||||
('sharpAngle', c_float),
|
||||
('alpha', c_float), # Unused
|
||||
('scaleFact', c_float), #Unused
|
||||
('hasFeature', c_bool),
|
||||
('hasField', c_bool),
|
||||
]
|
||||
|
||||
|
||||
class QRParameters(Structure):
|
||||
_fields_ = [
|
||||
("useFlowSolver", c_bool),
|
||||
("flow_config_filename", c_char_p),
|
||||
("satsuma_config_filename", c_char_p),
|
||||
("initialRemeshing", c_bool),
|
||||
("initialRemeshingEdgeFactor", c_double),
|
||||
("reproject", c_bool),
|
||||
("splitConcaves", c_bool),
|
||||
("finalSmoothing", c_bool),
|
||||
|
||||
("ilpMethod", c_int),
|
||||
("alpha", c_double),
|
||||
("isometry", c_bool),
|
||||
("regularityQuadrilaterals", c_bool),
|
||||
("regularityNonQuadrilaterals", c_bool),
|
||||
("regularityNonQuadrilateralsWeight", c_double),
|
||||
("alignSingularities", c_bool),
|
||||
("alignSingularitiesWeight", c_double),
|
||||
("repeatLosingConstraintsIterations", c_bool),
|
||||
("repeatLosingConstraintsQuads", c_bool),
|
||||
("repeatLosingConstraintsNonQuads", c_bool),
|
||||
("repeatLosingConstraintsAlign", c_bool),
|
||||
("feasibilityFix", c_bool),
|
||||
("hardParityConstraint", c_bool),
|
||||
|
||||
("timeLimit", c_double),
|
||||
("gapLimit", c_double),
|
||||
("minimumGap", c_double),
|
||||
("callbackTimeLimit", POINTER(c_float)),
|
||||
("callbackGapLimit", POINTER(c_float)),
|
||||
|
||||
("chartSmoothingIterations", c_int),
|
||||
("quadrangulationFixedSmoothingIterations", c_int),
|
||||
("quadrangulationNonFixedSmoothingIterations", c_int),
|
||||
("doubletRemoval", c_bool),
|
||||
|
||||
("resultSmoothingIterations", c_int),
|
||||
("resultSmoothingNRing", c_double),
|
||||
("resultSmoothingLaplacianIterations", c_int),
|
||||
("resultSmoothingLaplacianNRing", c_double),
|
||||
]
|
||||
|
||||
|
||||
def create_string(input):
|
||||
return create_string_buffer(str.encode(input, encoding='utf-8'))
|
||||
|
||||
|
||||
def create_default_QRParameters():
|
||||
callbackTimeLimitDefault = [3.00, 5.000, 10.0, 20.0, 30.0, 60.0, 90.0, 120.0]
|
||||
callbackGapLimitDefault = [0.005, 0.02, 0.05, 0.10, 0.15, 0.20, 0.25, 0.3]
|
||||
|
||||
params = QRParameters()
|
||||
|
||||
# Possibly unused
|
||||
params.initialRemeshing = True
|
||||
params.initialRemeshingEdgeFactor = 1
|
||||
params.reproject = True
|
||||
params.splitConcaves = False
|
||||
params.finalSmoothing = True
|
||||
params.doubletRemoval = True
|
||||
params.resultSmoothingIterations = 5
|
||||
params.resultSmoothingNRing = 3
|
||||
params.resultSmoothingLaplacianIterations = 2
|
||||
params.resultSmoothingLaplacianNRing = 3
|
||||
|
||||
# From configs
|
||||
params.alpha = 0.005
|
||||
params.ilpMethod = 1
|
||||
params.timeLimit = 200
|
||||
params.gapLimit = 0.0
|
||||
params.callbackTimeLimit = (c_float * len(callbackTimeLimitDefault))(*callbackTimeLimitDefault)
|
||||
params.callbackGapLimit = (c_float * len(callbackGapLimitDefault))(*callbackGapLimitDefault)
|
||||
params.minimumGap = 0.4
|
||||
params.isometry = 1
|
||||
params.regularityQuadrilaterals = 1
|
||||
params.regularityNonQuadrilaterals = 1
|
||||
params.regularityNonQuadrilateralsWeight = 0.9
|
||||
params.alignSingularities = 1
|
||||
params.alignSingularitiesWeight = 0.1
|
||||
params.repeatLosingConstraintsIterations = 1
|
||||
params.repeatLosingConstraintsQuads = 0
|
||||
params.repeatLosingConstraintsNonQuads = 0
|
||||
params.repeatLosingConstraintsAlign = 1
|
||||
params.hardParityConstraint = 1
|
||||
params.useFlowSolver = 1
|
||||
params.flow_config_filename = "config/main_config/flow_virtual_simple.json".encode()
|
||||
params.satsuma_config_filename = "config/satsuma/default.json".encode()
|
||||
|
||||
# Hardcoded in lib
|
||||
params.chartSmoothingIterations = 0
|
||||
params.quadrangulationFixedSmoothingIterations = 0
|
||||
params.quadrangulationNonFixedSmoothingIterations = 0
|
||||
params.feasibilityFix = False
|
||||
|
||||
return params
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user