1#include <pybind11/functional.h>
2#include <pybind11/iostream.h>
3#include <pybind11/pybind11.h>
4#include <pybind11/stl.h>
54#include <vcLogger.hpp>
55#include <vcSmartPointer.hpp>
58namespace py = pybind11;
69 typedef std::array<viennahrle::CoordType, 3> vectorType;
70 typedef std::array<viennahrle::CoordType, 6> boundsType;
75 bool isInside(
const vectorType &initial,
const vectorType &candidate,
76 double eps = 0.)
const override {
77 PYBIND11_OVERLOAD(
bool, ClassType,
isInside, initial, candidate, eps);
81 unsigned long initialPointId)
const override {
87 PYBIND11_OVERLOAD_PURE(boundsType, ClassType,
getBounds);
91template <
int D>
void bindApi(py::module &module) {
93 py::class_<viennahrle::Grid<D>>(module,
"hrleGrid");
96 py::class_<Domain<T, D>, SmartPointer<Domain<T, D>>>(module,
"Domain")
98 .def(py::init(&SmartPointer<
Domain<T, D>>::template New<>))
101 &SmartPointer<
Domain<T, D>>::template New<viennahrle::CoordType>),
102 py::arg(
"gridDelta") = 1.0)
106 .def(py::init([](std::array<viennahrle::CoordType, 2 * D> bounds,
107 std::array<BoundaryConditionEnum, D> bcs,
108 viennahrle::CoordType gridDelta) {
109 return SmartPointer<Domain<T, D>>::New(bounds.data(), bcs.data(),
112 py::arg(
"bounds"), py::arg(
"boundaryConditions"),
113 py::arg(
"gridDelta") = 1.0)
114 .def(py::init(&SmartPointer<
Domain<T, D>>::template New<
115 std::vector<viennahrle::CoordType>, std::vector<unsigned>,
116 viennahrle::CoordType>),
117 py::arg(
"bounds"), py::arg(
"boundaryConditions"),
118 py::arg(
"gridDelta") = 1.0)
129 .def(py::init(&SmartPointer<
Domain<T, D>>::template New<
132 &SmartPointer<
Domain<T, D>>::template New<viennahrle::Grid<D> &>))
135 "Copy lsDomain in this lsDomain.")
137 "Get the number of segments, the level set structure is divided "
140 "Get the number of defined level set values.")
142 "Get the number of layers of level set points around the explicit "
145 "Set the number of layers of level set points which should be "
146 "stored around the explicit surface.")
148 "Clear all metadata stored in the level set.")
153 if (!(py::hasattr(fileHandle,
"write") &&
154 py::hasattr(fileHandle,
"flush"))) {
155 throw py::type_error(
156 "MyClass::read_from_file_like_object(file): incompatible "
157 "function argument: `file` must be a file-like object, but "
159 (std::string)(py::repr(fileHandle)) +
"` provided");
161 py::detail::pythonbuf buf(fileHandle);
162 std::ostream stream(&buf);
165 py::arg(
"stream") = py::module::import(
"sys").attr(
"stdout"));
168 py::class_<Advect<T, D>, SmartPointer<Advect<T, D>>>(module,
"Advect")
170 .def(py::init(&SmartPointer<
Advect<T, D>>::template New<>))
171 .def(py::init(&SmartPointer<
Advect<T, D>>::template New<
178 "Insert next level set to use for advection.")
180 "Clear all level sets used for advection.")
182 "Set the velocity to use for advection.")
184 "Set the time until when the level set should be advected.")
186 "Set whether only a single advection step should be performed.")
188 "Set the maximum time step size relative to grid size. Advection is "
189 "only stable for <0.5.")
190 .def(
"setCalculateNormalVectors",
192 "Set whether normal vectors are needed for the supplied velocity "
195 "Set whether voids in the geometry should be ignored during "
198 py::arg(
"enabled") =
true, py::arg(
"subdivisions") = 20,
199 "Enable/disable adaptive time stepping and set the number of "
202 "setSaveAdvectionVelocities",
204 "Set whether the velocities applied to each point should be saved in "
205 "the level set for debug purposes.")
207 py::arg(
"check"),
"Enable/disable dissipation checking.")
210 "Enable/disable updating point data after advection.")
212 "Get the time passed during advection.")
214 "Get how many advection steps were performed after the last apply() "
217 "Get the time step ratio used for advection.")
219 "Get the current time step.")
220 .def(
"getCalculateNormalVectors",
222 "Get whether normal vectors are computed during advection.")
224 "Set the spatial discretization scheme to use during advection.")
226 "Set the time integration scheme to use during advection.")
228 "(DEPRECATED, use setSpatialScheme instead) Set the spatial "
229 "discretization scheme to use during advection.")
231 "Set the dissipation value to use for Lax Friedrichs spatial "
234 "Set whether the point data in the old LS should be translated to "
235 "the advected LS. Defaults to true.")
238 "Set a callback function that is called after the level set has been "
239 "updated during intermediate time integration steps (e.g. RK2, RK3).")
244 py::call_guard<py::gil_scoped_release>(),
"Perform advection.");
246 py::class_<lsInternal::StencilLocalLaxFriedrichsScalar<T, D, 1>>(
247 module,
"StencilLocalLaxFriedrichsScalar")
251 1>::setMaxDissipation,
252 py::arg(
"maxDissipation"));
254 module.def("PrepareStencilLocalLaxFriedrichs",
255 &PrepareStencilLocalLaxFriedrichs<T, D>, py::arg("levelSets"),
258 module.def("FinalizeStencilLocalLaxFriedrichs",
259 &FinalizeStencilLocalLaxFriedrichs<T, D>, py::arg("levelSets"));
262 py::class_<BooleanOperation<T, D>, SmartPointer<BooleanOperation<T, D>>>(
263 module,
"BooleanOperation")
275 return SmartPointer<BooleanOperation<T, D>>::New(domain, op);
280 return SmartPointer<BooleanOperation<T, D>>::New(domainA, domainB, op);
284 "Set levelset on which the boolean operation should be performed.")
286 "Set second levelset for boolean operation.")
288 "Set which type of boolean operation should be performed.")
290 "Perform the boolean operation.");
292 py::class_<CalculateCurvatures<T, D>,
293 SmartPointer<CalculateCurvatures<T, D>>>(module,
294 "CalculateCurvatures")
302 return SmartPointer<CalculateCurvatures<T, D>>::New(domain, type);
306 "Set levelset for which to calculate the curvatures.")
308 "Set which method to use for calculation: Defaults to mean "
311 "Curvatures will be calculated for all LS values < maxValue.")
313 "Perform normal vector calculation.");
316 py::class_<CalculateNormalVectors<T, D>,
317 SmartPointer<CalculateNormalVectors<T, D>>>(
318 module,
"CalculateNormalVectors")
326 "Set levelset for which to calculate normal vectors.")
328 "Set the maximum value for which normals should be calculated.")
330 "Set the method to use for normal calculation.")
332 "Perform normal vector calculation.");
335 py::class_<CalculateVisibilities<T, D>,
336 SmartPointer<CalculateVisibilities<T, D>>>(module,
337 "CalculateVisibilities")
340 SmartPointer<
Domain<T, D>> &,
const Vec3D<T> &, std::string>))
344 py::class_<Check<T, D>, SmartPointer<Check<T, D>>>(module,
"Check")
346 .def(py::init(&SmartPointer<
Check<T, D>>::template New<>))
347 .def(py::init(&SmartPointer<
Check<T, D>>::template New<
351 "Set levelset for which to calculate normal vectors.")
355 py::class_<PointCloud<T, D>, SmartPointer<PointCloud<T, D>>>(module,
359 const std::vector<VectorType<T, D>> &>))
361 .def(
"insertNextPoint",
366 py::class_<ConvexHull<T, D>, SmartPointer<ConvexHull<T, D>>>(module,
374 "Set mesh object where the generated mesh should be stored.")
376 "Set point cloud used to generate mesh.")
380 py::class_<DetectFeatures<T, D>, SmartPointer<DetectFeatures<T, D>>>(
381 module,
"DetectFeatures")
390 .def(py::init([](SmartPointer<
Domain<T, D>> &domain,
T maxValue,
392 return SmartPointer<DetectFeatures<T, D>>::New(domain, maxValue, type);
394 .def(
"setDetectionThreshold",
396 "Set the curvature value above which a point is considered a "
399 "Set which method to use to detect features. Defaults to Curvature.")
403 py::class_<GeometricAdvect<T, D>, SmartPointer<GeometricAdvect<T, D>>>(
404 module,
"GeometricAdvect")
414 "Set levelset to advect.")
416 "setAdvectionDistribution",
418 "Set advection distribution to use as kernel for the fast advection.")
420 py::call_guard<py::gil_scoped_release>(),
"Perform advection.");
423 py::class_<GeometricAdvectDistribution<T, D>,
424 SmartPointer<GeometricAdvectDistribution<T, D>>,
426 "GeometricAdvectDistribution")
431 "Check whether passed point is inside the distribution.")
432 .def(
"getSignedDistance",
434 "Get the signed distance of the passed point to the surface of the "
437 "Get the cartesian bounds of the distribution.")
439 "Prepare the distribution for use with the passed level set.")
441 "Finalize the distribution after use with the level set.");
443 py::class_<SphereDistribution<T, D>, SmartPointer<SphereDistribution<T, D>>,
449 "Check whether passed point is inside the distribution.")
451 "Get the signed distance of the passed point to the surface of the "
454 "Get the cartesian bounds of the distribution.");
456 py::class_<BoxDistribution<T, D>, SmartPointer<BoxDistribution<T, D>>,
460 const std::array<T, 3>>))
463 "Check whether passed point is inside the distribution.")
465 "Get the signed distance of the passed point to the surface of the "
468 "Get the cartesian bounds of the distribution.");
470 py::class_<CustomSphereDistribution<T, D>,
471 SmartPointer<CustomSphereDistribution<T, D>>,
473 "CustomSphereDistribution")
476 const std::vector<T> &>))
479 "Check whether passed point is inside the distribution.")
480 .def(
"getSignedDistance",
482 "Get the signed distance of the passed point to the surface of the "
485 "Get the cartesian bounds of the distribution.");
488 py::class_<Expand<T, D>, SmartPointer<Expand<T, D>>>(module,
"Expand")
490 .def(py::init(&SmartPointer<
Expand<T, D>>::template New<>))
491 .def(py::init(&SmartPointer<
Expand<T, D>>::template New<
493 .def(py::init(&SmartPointer<
Expand<T, D>>::template New<
501 py::class_<FromSurfaceMesh<T, D>, SmartPointer<FromSurfaceMesh<T, D>>>(
502 module,
"FromSurfaceMesh")
512 "Set levelset to read into.")
514 "Set the mesh to read from.")
515 .def(
"setRemoveBoundaryTriangles",
518 "Set whether to include mesh elements outside of the simulation "
520 .def(
"setRemoveBoundaryTriangles",
523 "Set whether to include mesh elements outside of the simulation "
526 "Construct a levelset from a surface mesh.");
529 py::class_<FromVolumeMesh<T, D>, SmartPointer<FromVolumeMesh<T, D>>>(
530 module,
"FromVolumeMesh")
538 SmartPointer<
Mesh<T>> &,
bool>))
541 "Set the grid used to read in the level sets.")
543 "Set the mesh to read from.")
544 .def(
"setRemoveBoundaryTriangles",
546 "Set whether to include mesh elements outside of the simulation "
549 "Construct a levelset from a volume mesh.");
552 py::class_<FromMesh<T, D>, SmartPointer<FromMesh<T, D>>>(module,
"FromMesh")
562 py::class_<Sphere<T, D>, SmartPointer<Sphere<T, D>>>(module,
"Sphere")
564 .def(py::init(&SmartPointer<
Sphere<T, D>>::template New<
565 const std::vector<T> & ,
T >),
566 py::arg(
"origin"), py::arg(
"radius"));
568 py::class_<Plane<T, D>, SmartPointer<Plane<T, D>>>(module,
"Plane")
570 .def(py::init(&SmartPointer<
Plane<T, D>>::template New<
571 const std::vector<T> & ,
572 const std::vector<T> & >),
573 py::arg(
"origin"), py::arg(
"normal"));
575 py::class_<Box<T, D>, SmartPointer<Box<T, D>>>(module,
"Box")
577 .def(py::init(&SmartPointer<
Box<T, D>>::template New<
578 const std::vector<T> & ,
579 const std::vector<T> & >),
580 py::arg(
"minPoint"), py::arg(
"maxPoint"));
582 py::class_<Cylinder<T, D>, SmartPointer<Cylinder<T, D>>>(module,
"Cylinder")
586 const std::vector<T> & ,
587 const std::vector<T> & ,
const T ,
588 const T ,
const T >),
589 py::arg(
"origin"), py::arg(
"axisDirection"), py::arg(
"height"),
590 py::arg(
"radius"), py::arg(
"topRadius") = 0.);
593 py::class_<MakeGeometry<T, D>, SmartPointer<MakeGeometry<T, D>>>(
594 module,
"MakeGeometry")
614 "Set the levelset in which to create the geometry.")
630 .def(
"setIgnoreBoundaryConditions",
633 .def(
"setIgnoreBoundaryConditions",
639 py::class_<MarkVoidPoints<T, D>, SmartPointer<MarkVoidPoints<T, D>>>(
640 module,
"MarkVoidPoints")
649 "Set the levelset to mark void points in.")
650 .def(
"setReverseVoidDetection",
652 "Reverse the logic of detecting the top surface.")
653 .def(
"setDetectLargestSurface",
655 "Set that the top surface should be the one with the most connected "
658 "Set the logic by which to choose the surface which is non-void. "
659 "All other connected surfaces will then be marked as void points.")
661 "Save the connectivity information of all LS points in the "
662 "pointData of the level set.")
663 .def(
"getNumberOfComponents",
665 "Get the number of connected components found in the level set.")
669 py::class_<Prune<T, D>, SmartPointer<Prune<T, D>>>(module,
"Prune")
671 .def(py::init(&SmartPointer<
Prune<T, D>>::template New<>))
672 .def(py::init(&SmartPointer<
Prune<T, D>>::template New<
679 py::class_<Reader<T, D>, SmartPointer<Reader<T, D>>>(module,
"Reader")
681 .def(py::init(&SmartPointer<
Reader<T, D>>::template New<>))
682 .def(py::init(&SmartPointer<
Reader<T, D>>::template New<
684 .def(py::init(&SmartPointer<
Reader<T, D>>::template New<
688 "Set levelset to write to file.")
690 "Set the filename for the output file.")
694 py::class_<Reduce<T, D>, SmartPointer<Reduce<T, D>>>(module,
"Reduce")
696 .def(py::init(&SmartPointer<
Reduce<T, D>>::template New<>))
697 .def(py::init(&SmartPointer<
Reduce<T, D>>::template New<
699 .def(py::init(&SmartPointer<
Reduce<T, D>>::template New<
701 .def(py::init(&SmartPointer<
Reduce<T, D>>::template New<
707 "Set whether the levelset should be segmented anew (balanced across "
708 "cores) after reduction.")
712 py::class_<RemoveStrayPoints<T, D>, SmartPointer<RemoveStrayPoints<T, D>>>(
713 module,
"RemoveStrayPoints")
720 "Set levelset for stray point removal.")
722 "Set the logic by which to choose the surface which should be kept. "
723 "All other LS values will be marked as stray points and removed.")
727 py::class_<ToDiskMesh<T, D>, SmartPointer<ToDiskMesh<T, D>>>(module,
735 "Set levelset to mesh.")
737 "Clear all inserted level sets.")
739 "Insert next level set to output in the disk mesh.")
742 "Set the material map to use for the disk mesh.")
744 "Set the maximum level set value to include in the disk mesh.")
746 "Convert the levelset to a surface mesh.");
749 py::class_<ToMesh<T, D>, SmartPointer<ToMesh<T, D>>>(module,
"ToMesh")
751 .def(py::init(&SmartPointer<
ToMesh<T, D>>::template New<>))
752 .def(py::init(&SmartPointer<
ToMesh<T, D>>::template New<
757 .def(py::init(&SmartPointer<
ToMesh<T, D>>::template New<
764 "Set whether only defined points should be output to the mesh.")
766 "Set whether only level set points <0.5 should be output.")
768 "Convert the levelset to a surface mesh.");
771 py::class_<ToSurfaceMesh<T, D>, SmartPointer<ToSurfaceMesh<T, D>>>(
772 module,
"ToSurfaceMesh")
777 py::arg(
"minNodeDistFactor") = 0.05, py::arg(
"eps") = 1e-12)
781 py::arg(
"domain"), py::arg(
"mesh"),
782 py::arg(
"minNodeDistFactor") = 0.05, py::arg(
"eps") = 1e-12)
785 "Set levelset to mesh.")
787 "Set the mesh to generate.")
789 "Set whether to update point data. Defaults to true.")
791 "Set whether to preserve sharp corners. Defaults to false.")
793 "Convert the levelset to a surface mesh.");
796 py::class_<ToMultiSurfaceMesh<T, D>, SmartPointer<ToMultiSurfaceMesh<T, D>>>(
797 module,
"ToMultiSurfaceMesh")
802 py::arg(
"minNodeDistFactor") = 0.05, py::arg(
"eps") = 1e-12)
806 py::arg(
"domain"), py::arg(
"mesh"),
807 py::arg(
"minNodeDistFactor") = 0.05, py::arg(
"eps") = 1e-12)
810 SmartPointer<
Mesh<T>> &,
double,
double>),
811 py::arg(
"domains"), py::arg(
"mesh"),
812 py::arg(
"minNodeDistFactor") = 0.05, py::arg(
"eps") = 1e-12)
814 SmartPointer<
Mesh<T>> &,
double,
double>),
815 py::arg(
"mesh"), py::arg(
"minNodeDistFactor") = 0.05,
816 py::arg(
"eps") = 1e-12)
819 "Insert next level set to output in the mesh.")
821 "Clear all inserted level sets.")
823 "Set the mesh to generate.")
825 "Set the material map to use for the multi surface mesh.")
827 "Set whether to preserve sharp corners. Defaults to false.")
829 "Convert the levelset to a surface mesh.");
832 py::class_<ToVoxelMesh<T, D>, SmartPointer<ToVoxelMesh<T, D>>>(module,
845 "Insert next level set to output in the mesh.")
847 "Clear all inserted level sets.")
850 "Convert the levelset to a surface mesh.");
853 py::class_<Writer<T, D>, SmartPointer<Writer<T, D>>>(module,
"Writer")
855 .def(py::init(&SmartPointer<
Writer<T, D>>::template New<>))
856 .def(py::init(&SmartPointer<
Writer<T, D>>::template New<
858 .def(py::init(&SmartPointer<
Writer<T, D>>::template New<
862 "Set levelset to write to file.")
864 "Set the filename for the output file.")
868 py::class_<CompareSparseField<T, D>, SmartPointer<CompareSparseField<T, D>>>(
869 module,
"CompareSparseField")
876 .def(
"setLevelSetExpanded",
878 "Sets the expanded level set for comparison.")
879 .def(
"setLevelSetIterated",
881 "Sets the iterated level set to compare against the expanded one.")
883 "Set the x-coordinate range to restrict the comparison area")
885 "Set the y-coordinate range to restrict the comparison area")
887 "Clear the x-range restriction")
889 "Clear the y-range restriction")
891 "Set the z-coordinate range to restrict the comparison area")
893 "Clear the z-range restriction")
895 "Set the output mesh where difference values will be stored")
896 .def(
"setFillIteratedWithDistances",
898 "Set whether to fill the iterated level set with distance values")
899 .def(
"setExpandedLevelSetWidth",
901 "Set the expansion width for the expanded level set")
903 "Apply the comparison and calculate the sum of squared "
905 .def(
"getSumSquaredDifferences",
907 "Return the sum of squared differences calculated by apply().")
909 "Return the sum of absolute differences calculated by apply().")
911 "Return the number of points used in the comparison.")
912 .def(
"getNumSkippedPoints",
914 "Return the number of points skipped during comparison.")
916 "Calculate the root mean square error from previously computed "
920#ifdef VIENNALS_USE_VTK
921 py::class_<WriteVisualizationMesh<T, D>,
922 SmartPointer<WriteVisualizationMesh<T, D>>>(
923 module,
"WriteVisualizationMesh")
926 py::init(&SmartPointer<WriteVisualizationMesh<T, D>>::template New<>))
927 .def(py::init(&SmartPointer<WriteVisualizationMesh<T, D>>::template New<
930 .def(
"insertNextLevelSet",
931 &WriteVisualizationMesh<T, D>::insertNextLevelSet,
932 "Insert next level set to convert. Bigger level sets wrapping "
933 "smaller ones, should be inserted last.")
934 .def(
"setFileName", &WriteVisualizationMesh<T, D>::setFileName,
935 "Set Name of File to write.")
936 .def(
"setExtractHullMesh",
937 &WriteVisualizationMesh<T, D>::setExtractHullMesh,
938 "Whether to extract a hull mesh. Defaults to false.")
939 .def(
"setExtractVolumeMesh",
940 &WriteVisualizationMesh<T, D>::setExtractVolumeMesh,
941 " Whether to extract a tetra volume mesh. Defaults to true.")
942 .def(
"setMetaData", &WriteVisualizationMesh<T, D>::setMetaData,
943 "Set the metadata to be written to the file.")
945 py::overload_cast<const std::string &, T>(
946 &WriteVisualizationMesh<T, D>::addMetaData),
947 "Add a single metadata entry to the file.")
949 py::overload_cast<
const std::string &,
const std::vector<T> &>(
950 &WriteVisualizationMesh<T, D>::addMetaData),
951 "Add a single metadata entry to the file.")
954 const std::unordered_map<std::string, std::vector<T>> &>(
955 &WriteVisualizationMesh<T, D>::addMetaData),
956 "Add metadata to the file.")
957 .def(
"apply", &WriteVisualizationMesh<T, D>::apply,
958 "Make and write mesh.");
962 py::class_<CompareVolume<T, D>, SmartPointer<CompareVolume<T, D>>>(
963 module,
"CompareVolume")
971 "Sets the target level set.")
973 "Sets the sample level set.")
975 "Set default increment value")
977 "Sets the x-range and custom increment value")
979 "Sets the y-range and custom increment value")
981 "Sets the z-range and custom increment value")
983 "Set the output mesh where difference areas will be stored")
985 "Returns the computed volume mismatch.")
987 "Returns the computed area mismatch.")
988 .def(
"getCustomVolumeMismatch",
990 "Returns the computed volume mismatch, with custom increments "
993 "Returns the computed area mismatch, with custom increments "
996 "Returns the number of cells where the level sets differ.")
998 "Returns the number of cells where the level sets differ, with "
999 "custom increments applied.")
1001 "Computes the volume difference between the two level sets.");
1003 if constexpr (
D == 2) {
1004 module.attr("CompareArea") = module.attr("CompareVolume");
1008 py::class_<CompareChamfer<T, D>, SmartPointer<CompareChamfer<T, D>>>(
1009 module,
"CompareChamfer")
1017 "Set the target level set.")
1019 "Set the sample level set.")
1021 "Set output mesh for target surface points with distance data.")
1023 "Set output mesh for sample surface points with distance data.")
1025 "Apply the Chamfer distance calculation.")
1027 "Get the forward distance (average distance from target to "
1030 "Get the backward distance (average distance from sample to "
1033 "Get the Chamfer distance (average of forward and backward).")
1034 .def(
"getRMSChamferDistance",
1036 "Get the RMS Chamfer distance.")
1038 "Get the maximum nearest-neighbor distance.")
1040 "Get the number of target surface points.")
1042 "Get the number of sample surface points.");
1045 py::class_<CompareCriticalDimensions<T, D>,
1046 SmartPointer<CompareCriticalDimensions<T, D>>>(
1047 module,
"CompareCriticalDimensions")
1055 .def(
"setLevelSetTarget",
1057 "Sets the target level set.")
1058 .def(
"setLevelSetSample",
1060 "Sets the sample level set.")
1062 py::arg(
"measureDimension"), py::arg(
"minBounds"),
1063 py::arg(
"maxBounds"), py::arg(
"findMaximum") =
true,
1064 "Add a generic range specification.")
1066 py::arg(
"minX"), py::arg(
"maxX"), py::arg(
"findMaximum") =
true,
1067 "Add an X range to find maximum or minimum Y position.")
1069 py::arg(
"minY"), py::arg(
"maxY"), py::arg(
"findMaximum") =
true,
1070 "Add a Y range to find maximum or minimum X position.")
1072 "Clear all range specifications.")
1074 "Set the output mesh where critical dimension locations will be "
1077 "Apply the comparison.")
1078 .def(
"getNumCriticalDimensions",
1080 "Get the number of critical dimensions compared.")
1082 "getCriticalDimensionResult",
1084 T posRef{}, posCmp{}, diff{};
1088 return py::make_tuple(
true, posRef, posCmp, diff);
1089 return py::make_tuple(
false,
T(0),
T(0),
T(0));
1092 "Get a specific critical dimension result. Returns (valid, "
1093 "positionTarget, positionSample, difference).")
1094 .def(
"getMeanDifference",
1096 "Get mean absolute difference across all valid critical "
1098 .def(
"getMaxDifference",
1100 "Get maximum difference across all valid critical dimensions.")
1102 "Get RMSE across all valid critical dimensions.")
1103 .def(
"getAllDifferences",
1105 "Get all valid differences as a list.");
1108 py::class_<CompareNarrowBand<T, D>, SmartPointer<CompareNarrowBand<T, D>>>(
1109 module,
"CompareNarrowBand")
1117 "Sets the target level set.")
1119 "Sets the sample level set.")
1121 "Set the x-coordinate range to restrict the comparison area")
1123 "Set the y-coordinate range to restrict the comparison area")
1125 "Clear the x-range restriction")
1127 "Clear the y-range restriction")
1129 "Set the z-coordinate range to restrict the comparison area")
1131 "Clear the z-range restriction")
1133 "Set the output mesh where difference values will be stored")
1134 .def(
"setOutputMeshSquaredDifferences",
1136 "Set whether to output squared differences (true) or absolute "
1137 "differences (false)")
1139 "Apply the comparison and calculate the sum of squared "
1141 .def(
"getSumSquaredDifferences",
1143 "Return the sum of squared differences calculated by apply().")
1145 "Return the sum of absolute differences calculated by apply().")
1147 "Return the number of points used in the comparison.")
1149 "Calculate the root mean square error from previously computed "
constexpr int D
Definition Epitaxy.cpp:11
double T
Definition Epitaxy.cpp:12
T getSignedDistance(const vectorType &initial, const vectorType &candidate, unsigned long initialPointId) const override
Definition pyWrap.hpp:80
bool isInside(const vectorType &initial, const vectorType &candidate, double eps=0.) const override
Definition pyWrap.hpp:75
boundsType getBounds() const override
Sets bounds to the bounding box of the distribution.
Definition pyWrap.hpp:86
Stencil Local Lax Friedrichs Discretization Scheme. It uses a stencil of order around active points,...
Definition lsStencilLocalLaxFriedrichsScalar.hpp:33
This class is used to advance level sets over time. Level sets are passed to the constructor in a std...
Definition lsAdvect.hpp:54
void setVelocityField(SmartPointer< VelocityField< T > > passedVelocities)
Set the velocity field used for advection. This should be a concrete implementation of lsVelocityFiel...
Definition lsAdvect.hpp:863
void insertNextLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Pushes the passed level set to the back of the list of level sets used for advection.
Definition lsAdvect.hpp:855
void setVelocityUpdateCallback(std::function< bool(SmartPointer< Domain< T, D > >)> callback)
Set a callback function that is called after the level set has been updated during intermediate time ...
Definition lsAdvect.hpp:965
void setUpdatePointData(bool update)
Set whether the point data in the old LS should be translated to the advected LS. Defaults to true.
Definition lsAdvect.hpp:961
void setSpatialScheme(SpatialSchemeEnum scheme)
Set which spatial discretization scheme should be used out of the ones specified in SpatialSchemeEnum...
Definition lsAdvect.hpp:935
bool getCalculateNormalVectors() const
Get whether normal vectors were calculated.
Definition lsAdvect.hpp:931
void setIgnoreVoids(bool iV)
Set whether level set values, which are not part of the "top" geometrically connected part of values,...
Definition lsAdvect.hpp:898
void clearLevelSets()
Definition lsAdvect.hpp:859
void setCalculateNormalVectors(bool cnv)
Set whether normal vectors should be calculated at each level set point. Defaults to true....
Definition lsAdvect.hpp:890
void apply()
Definition lsAdvect.hpp:1016
void setSingleStep(bool singleStep)
If set to true, only a single advection step will be performed, even if the advection time set with s...
Definition lsAdvect.hpp:878
void prepareLS()
Definition lsAdvect.hpp:972
double getAdvectedTime() const
Get by how much the physical time was advanced during the last apply() call.
Definition lsAdvect.hpp:919
void setTemporalScheme(TemporalSchemeEnum scheme)
Set which time integration scheme should be used.
Definition lsAdvect.hpp:948
void setDissipationAlpha(const double &a)
Set the alpha dissipation coefficient. For lsLaxFriedrichs, this is used as the alpha value....
Definition lsAdvect.hpp:954
void setCheckDissipation(bool check)
Definition lsAdvect.hpp:957
void setIntegrationScheme(IntegrationSchemeEnum scheme)
Definition lsAdvect.hpp:940
double getCurrentTimeStep() const
Return the last applied time step.
Definition lsAdvect.hpp:922
void setAdvectionTime(double time)
Set the time until when the level set should be advected. If this takes more than one advection step,...
Definition lsAdvect.hpp:872
unsigned getNumberOfTimeSteps() const
Get how many advection steps were performed during the last apply() call.
Definition lsAdvect.hpp:925
void setAdaptiveTimeStepping(bool aTS=true, unsigned subdivisions=20)
Set whether adaptive time stepping should be used when approaching material boundaries during etching...
Definition lsAdvect.hpp:903
void setTimeStepRatio(const double &cfl)
Set the CFL condition to use during advection. The CFL condition sets the maximum distance a surface ...
Definition lsAdvect.hpp:884
double getTimeStepRatio() const
Get the value of the CFL number.
Definition lsAdvect.hpp:928
void setSaveAdvectionVelocities(bool sAV)
Set whether the velocities applied to each point should be saved in the level set for debug purposes.
Definition lsAdvect.hpp:915
This class is used to perform boolean operations on two level sets and write the resulting level set ...
Definition lsBooleanOperation.hpp:45
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Set which level set to perform the boolean operation on.
Definition lsBooleanOperation.hpp:290
void setSecondLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Set the level set which will be used to modify the first level set.
Definition lsBooleanOperation.hpp:296
void setBooleanOperation(BooleanOperationEnum passedOperation)
Set which of the operations of BooleanOperationEnum to perform.
Definition lsBooleanOperation.hpp:301
void apply()
Perform operation.
Definition lsBooleanOperation.hpp:319
Concrete implementation of GeometricAdvectDistribution for a rectangular box distribution.
Definition lsGeometricAdvectDistributions.hpp:129
bool isInside(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, double eps) const override
Quick check whether a point relative to the distributions center is inside the distribution....
Definition lsGeometricAdvectDistributions.hpp:136
std::array< viennahrle::CoordType, 6 > getBounds() const override
Sets bounds to the bounding box of the distribution.
Definition lsGeometricAdvectDistributions.hpp:159
T getSignedDistance(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, unsigned long) const override
Returns the signed distance of a point relative to the distributions center. This is the signed manha...
Definition lsGeometricAdvectDistributions.hpp:148
Class describing a square box from one coordinate to another.
Definition lsGeometries.hpp:71
Definition lsCalculateCurvatures.hpp:24
void setCurvatureType(CurvatureEnum passedType)
Definition lsCalculateCurvatures.hpp:46
void setMaxValue(const T passedMaxValue)
Definition lsCalculateCurvatures.hpp:59
void apply()
Definition lsCalculateCurvatures.hpp:61
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCalculateCurvatures.hpp:42
This algorithm is used to compute the normal vectors for all points with level set values <= maxValue...
Definition lsCalculateNormalVectors.hpp:40
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCalculateNormalVectors.hpp:63
void apply()
Definition lsCalculateNormalVectors.hpp:95
void setMethod(NormalCalculationMethodEnum passedMethod)
Definition lsCalculateNormalVectors.hpp:79
void setMaxValue(const T passedMaxValue)
Definition lsCalculateNormalVectors.hpp:67
Definition lsCalculateVisibilities.hpp:10
void apply()
Definition lsCalculateVisibilities.hpp:25
This class is used to find errors in the underlying level set structure, like invalid neighbours of d...
Definition lsCheck.hpp:22
void apply()
Definition lsCheck.hpp:78
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCheck.hpp:66
Calculate Chamfer distance between two level sets by comparing their zero-level-set surfaces....
Definition lsCompareChamfer.hpp:39
unsigned getNumSamplePoints() const
Get the number of sample surface points.
Definition lsCompareChamfer.hpp:329
void apply()
Apply the Chamfer distance calculation.
Definition lsCompareChamfer.hpp:104
T getMaxDistance() const
Get the maximum nearest-neighbor distance.
Definition lsCompareChamfer.hpp:323
T getBackwardDistance() const
Get the backward distance (average distance from sample to target).
Definition lsCompareChamfer.hpp:314
void setOutputMeshSample(SmartPointer< Mesh< T > > passedMesh)
Set output mesh for sample surface points with distance data.
Definition lsCompareChamfer.hpp:99
T getRMSChamferDistance() const
Get the RMS Chamfer distance.
Definition lsCompareChamfer.hpp:320
T getChamferDistance() const
Get the Chamfer distance (average of forward and backward).
Definition lsCompareChamfer.hpp:317
T getForwardDistance() const
Get the forward distance (average distance from target to sample).
Definition lsCompareChamfer.hpp:311
void setOutputMeshTarget(SmartPointer< Mesh< T > > passedMesh)
Set output mesh for target surface points with distance data.
Definition lsCompareChamfer.hpp:94
void setLevelSetTarget(SmartPointer< Domain< T, D > > passedLevelSet)
Set the target level set.
Definition lsCompareChamfer.hpp:84
unsigned getNumTargetPoints() const
Get the number of target surface points.
Definition lsCompareChamfer.hpp:326
void setLevelSetSample(SmartPointer< Domain< T, D > > passedLevelSet)
Set the sample level set.
Definition lsCompareChamfer.hpp:89
Compares critical dimensions (surface positions) between two level sets. Critical dimensions are defi...
Definition lsCompareCriticalDimensions.hpp:33
void apply()
Apply the comparison.
Definition lsCompareCriticalDimensions.hpp:197
std::vector< T > getAllDifferences() const
Get all valid results.
Definition lsCompareCriticalDimensions.hpp:309
void setOutputMesh(SmartPointer< Mesh< T > > passedMesh)
Set the output mesh where critical dimension locations will be stored.
Definition lsCompareCriticalDimensions.hpp:192
bool getCriticalDimensionResult(size_t index, T &positionTarget, T &positionSample, T &difference) const
Get a specific critical dimension result.
Definition lsCompareCriticalDimensions.hpp:259
size_t getNumCriticalDimensions() const
Get the number of critical dimensions compared.
Definition lsCompareCriticalDimensions.hpp:256
void addRange(int measureDimension, const std::array< T, D > &minBounds, const std::array< T, D > &maxBounds, bool findMaximum=true)
Add a generic range specification.
Definition lsCompareCriticalDimensions.hpp:154
void addYRange(T minY, T maxY, bool findMaximum=true)
Add a Y range to find maximum or minimum X position.
Definition lsCompareCriticalDimensions.hpp:177
void clearRanges()
Clear all range specifications.
Definition lsCompareCriticalDimensions.hpp:189
void setLevelSetTarget(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareCriticalDimensions.hpp:145
T getMeanDifference() const
Get mean absolute difference across all valid critical dimensions.
Definition lsCompareCriticalDimensions.hpp:271
T getMaxDifference() const
Get maximum difference across all valid critical dimensions.
Definition lsCompareCriticalDimensions.hpp:284
void addXRange(T minX, T maxX, bool findMaximum=true)
Add an X range to find maximum or minimum Y position.
Definition lsCompareCriticalDimensions.hpp:165
T getRMSE() const
Get RMSE across all valid critical dimensions.
Definition lsCompareCriticalDimensions.hpp:295
void setLevelSetSample(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareCriticalDimensions.hpp:149
Calculate distance measure between two level sets by comparing their SDF values on a narrow band....
Definition lsCompareNarrowBand.hpp:19
void setYRange(T minYRange, T maxYRange)
Set the y-coordinate range to restrict the comparison area.
Definition lsCompareNarrowBand.hpp:164
void setOutputMeshSquaredDifferences(bool value)
Set whether to output squared differences (true) or absolute differences (false).
Definition lsCompareNarrowBand.hpp:207
void setXRange(T minXRange, T maxXRange)
Set the x-coordinate range to restrict the comparison area.
Definition lsCompareNarrowBand.hpp:157
void setOutputMesh(SmartPointer< Mesh< T > > passedMesh, bool outputMeshSquaredDiffs=true)
Set the output mesh where difference values will be stored.
Definition lsCompareNarrowBand.hpp:199
void clearZRange()
Clear the z-range restriction.
Definition lsCompareNarrowBand.hpp:192
void setLevelSetTarget(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareNarrowBand.hpp:148
T getRMSE() const
Calculate the root mean square error from previously computed values.
Definition lsCompareNarrowBand.hpp:387
void setLevelSetSample(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareNarrowBand.hpp:152
unsigned getNumPoints() const
Return the number of points used in the comparison.
Definition lsCompareNarrowBand.hpp:384
void clearYRange()
Clear the y-range restriction.
Definition lsCompareNarrowBand.hpp:178
T getSumSquaredDifferences() const
Return the sum of squared differences calculated by apply().
Definition lsCompareNarrowBand.hpp:378
void apply()
Apply the comparison and calculate the sum of squared differences.
Definition lsCompareNarrowBand.hpp:212
void clearXRange()
Clear the x-range restriction.
Definition lsCompareNarrowBand.hpp:171
T getSumDifferences() const
Definition lsCompareNarrowBand.hpp:381
void setZRange(T minZRange, T maxZRange)
Set the z-coordinate range to restrict the comparison area.
Definition lsCompareNarrowBand.hpp:185
Calculate distance measure between two level sets by comparing their SDF values on a sparse field....
Definition lsCompareSparseField.hpp:34
unsigned getNumPoints() const
Return the number of points used in the comparison.
Definition lsCompareSparseField.hpp:398
T getRMSE() const
Calculate the root mean square error from previously computed values.
Definition lsCompareSparseField.hpp:404
void setXRange(T minXRange, T maxXRange)
Set the x-coordinate range to restrict the comparison area.
Definition lsCompareSparseField.hpp:155
void setExpandedLevelSetWidth(int width)
Set the expansion width for the expanded level set This value will be used if the expanded level set ...
Definition lsCompareSparseField.hpp:209
void setOutputMesh(SmartPointer< Mesh< T > > passedMesh)
Set the output mesh where difference values will be stored.
Definition lsCompareSparseField.hpp:197
void setLevelSetIterated(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareSparseField.hpp:150
unsigned getNumSkippedPoints() const
Return the number of skipped points during the comparison.
Definition lsCompareSparseField.hpp:401
void setYRange(T minYRange, T maxYRange)
Set the y-coordinate range to restrict the comparison area.
Definition lsCompareSparseField.hpp:162
void setLevelSetExpanded(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsCompareSparseField.hpp:146
void setFillIteratedWithDistances(bool fill)
Set whether to fill the iterated level set with distances.
Definition lsCompareSparseField.hpp:202
T getSumSquaredDifferences() const
Return the sum of squared differences calculated by apply().
Definition lsCompareSparseField.hpp:392
T getSumDifferences() const
Return the sum of differences calculated by apply().
Definition lsCompareSparseField.hpp:395
void clearZRange()
Clear the z-range restriction.
Definition lsCompareSparseField.hpp:190
void clearYRange()
Clear the y-range restriction.
Definition lsCompareSparseField.hpp:176
void apply()
Apply the comparison and calculate the sum of squared differences.
Definition lsCompareSparseField.hpp:220
void clearXRange()
Clear the x-range restriction.
Definition lsCompareSparseField.hpp:169
void setZRange(T minZRange, T maxZRange)
Set the z-coordinate range to restrict the comparison area.
Definition lsCompareSparseField.hpp:183
Computes an estimate of the volume/area where two level sets differ. The volume is calculated by iter...
Definition lsCompareVolume.hpp:25
void setOutputMesh(SmartPointer< Mesh< T > > passedMesh)
Set the output mesh where difference areas will be stored for visualization. Each cell in the mesh wi...
Definition lsCompareVolume.hpp:171
unsigned long int getCellCount() const
Returns the number of cells where the level sets differ.
Definition lsCompareVolume.hpp:193
void setXRangeAndIncrement(hrleIndexType minXRange, hrleIndexType maxXRange, unsigned short int Xincrement)
Sets the x-range and custom increment value.
Definition lsCompareVolume.hpp:141
void setLevelSetTarget(SmartPointer< Domain< T, D > > passedLevelSet)
Sets the target level set.
Definition lsCompareVolume.hpp:126
void apply()
Computes the volume/area difference between the two level sets.
Definition lsCompareVolume.hpp:202
double getAreaMismatch() const
Alias for getVolumeMismatch for 2D compatibility.
Definition lsCompareVolume.hpp:181
void setYRangeAndIncrement(hrleIndexType minYRange, hrleIndexType maxYRange, unsigned short int Yincrement)
Sets the y-range and custom increment value.
Definition lsCompareVolume.hpp:150
void setZRangeAndIncrement(hrleIndexType minZRange, hrleIndexType maxZRange, unsigned short int Zincrement)
Sets the z-range and custom increment value.
Definition lsCompareVolume.hpp:159
void setDefaultIncrement(unsigned short int increment)
Set default increment value.
Definition lsCompareVolume.hpp:136
double getCustomVolumeMismatch() const
Returns the computed volume/area mismatch, with custom increments applied.
Definition lsCompareVolume.hpp:184
unsigned long int getCustomCellCount() const
Returns the number of cells where the level sets differ, with custom increments applied.
Definition lsCompareVolume.hpp:197
double getVolumeMismatch() const
Returns the computed volume/area mismatch.
Definition lsCompareVolume.hpp:176
void setLevelSetSample(SmartPointer< Domain< T, D > > passedLevelSet)
Sets the sample level set.
Definition lsCompareVolume.hpp:131
double getCustomAreaMismatch() const
Alias for getCustomVolumeMismatch for 2D compatibility.
Definition lsCompareVolume.hpp:190
This algorithm creates a convex hull mesh from a point cloud. This is done using the gift wrapping ap...
Definition lsConvexHull.hpp:23
void apply()
Definition lsConvexHull.hpp:332
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsConvexHull.hpp:326
void setPointCloud(SmartPointer< PointCloud< T, D > > passedPointCloud)
Definition lsConvexHull.hpp:328
Definition lsGeometricAdvectDistributions.hpp:185
T getSignedDistance(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, unsigned long pointId) const override
Returns the signed distance of a point relative to the distributions center. This is the signed manha...
Definition lsGeometricAdvectDistributions.hpp:198
std::array< viennahrle::CoordType, 6 > getBounds() const override
Sets bounds to the bounding box of the distribution.
Definition lsGeometricAdvectDistributions.hpp:242
Class describing a square box from one coordinate to another.
Definition lsGeometries.hpp:100
This class detects features of the level set function. This class offers two methods to determine fea...
Definition lsDetectFeatures.hpp:26
void apply()
Execute the algorithm.
Definition lsDetectFeatures.hpp:64
void setDetectionThreshold(T threshold)
Definition lsDetectFeatures.hpp:51
void setDetectionMethod(FeatureDetectionEnum passedMethod)
Set which algorithm to use to detect features. The curvature-based algorithm should always be preferr...
Definition lsDetectFeatures.hpp:59
Class containing all information about the level set, including the dimensions of the domain,...
Definition lsDomain.hpp:28
void clearMetaData()
Definition lsDomain.hpp:164
void deepCopy(const SmartPointer< Domain< T, D > > passedDomain)
copy all values of "passedDomain" to this Domain
Definition lsDomain.hpp:125
unsigned getNumberOfSegments() const
returns the number of segments, the levelset is split into. This is useful for algorithm parallelisat...
Definition lsDomain.hpp:154
void print(std::ostream &out=std::cout)
prints basic information and all memebers of the levelset structure
Definition lsDomain.hpp:179
int getLevelSetWidth() const
Definition lsDomain.hpp:159
unsigned getNumberOfPoints() const
returns the number of defined points
Definition lsDomain.hpp:157
void setLevelSetWidth(int width)
Definition lsDomain.hpp:161
Expands the levelSet to the specified number of layers. The largest value in the levelset is thus wid...
Definition lsExpand.hpp:17
void apply()
Apply the expansion to the specified width.
Definition lsExpand.hpp:44
void setWidth(int passedWidth)
Set how far the level set should be extended. Points with value width*0.5 will be added by this algor...
Definition lsExpand.hpp:37
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsExpand.hpp:31
Import the regular grid, on which the level set values are defined, from an explicit Mesh<>....
Definition lsFromMesh.hpp:16
void setMesh(const SmartPointer< Mesh< T > > passedMesh)
Definition lsFromMesh.hpp:34
void setSortPointList(bool passedSortPointList)
Definition lsFromMesh.hpp:36
void apply()
Definition lsFromMesh.hpp:40
Construct a level set from an explicit mesh.
Definition lsFromSurfaceMesh.hpp:15
void setRemoveBoundaryTriangles(bool passedRemoveBoundaryTriangles)
Set whether all triangles outside the domain should be ignored (=true) or whether boundary conditions...
Definition lsFromSurfaceMesh.hpp:227
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsFromSurfaceMesh.hpp:218
void apply()
Definition lsFromSurfaceMesh.hpp:243
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsFromSurfaceMesh.hpp:222
This class creates a level set from a tetrahedral mesh. If the mesh contains a scalar data array call...
Definition lsFromVolumeMesh.hpp:22
typename Domain< T, D >::GridType GridType
Definition lsFromVolumeMesh.hpp:26
void apply()
Definition lsFromVolumeMesh.hpp:56
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsFromVolumeMesh.hpp:48
void setGrid(const GridType &passedGrid)
Definition lsFromVolumeMesh.hpp:43
void setRemoveBoundaryTriangles(bool passedRemoveBoundaryTriangles)
Definition lsFromVolumeMesh.hpp:50
Base class for distributions used by lsGeometricAdvect. All functions are pure virtual and must be im...
Definition lsGeometricAdvectDistributions.hpp:15
virtual void prepare(SmartPointer< Domain< T, D > > domain)
Definition lsGeometricAdvectDistributions.hpp:43
virtual bool isInside(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, double eps) const
Quick check whether a point relative to the distributions center is inside the distribution....
Definition lsGeometricAdvectDistributions.hpp:23
virtual T getSignedDistance(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, unsigned long pointId) const =0
Returns the signed distance of a point relative to the distributions center. This is the signed manha...
virtual void finalize()
Definition lsGeometricAdvectDistributions.hpp:44
virtual std::array< viennahrle::CoordType, 6 > getBounds() const =0
Sets bounds to the bounding box of the distribution.
GeometricAdvectDistribution()=default
This class advects the level set according to a given distribution. This distribution is overlayed at...
Definition lsGeometricAdvect.hpp:35
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Set the levelset which should be advected.
Definition lsGeometricAdvect.hpp:76
void apply()
Perform geometrical advection.
Definition lsGeometricAdvect.hpp:95
void setAdvectionDistribution(SmartPointer< GeometricAdvectDistribution< T, D > > passedDist)
Set which advection distribution to use. Must be derived from GeometricAdvectDistribution.
Definition lsGeometricAdvect.hpp:82
Create level sets describing basic geometric forms.
Definition lsMakeGeometry.hpp:27
void setIgnoreBoundaryConditions(bool passedIgnoreBoundaryConditions)
Ignore boundary conditions, meaning the parts of the generated geometry which are outside of the doma...
Definition lsMakeGeometry.hpp:127
void apply()
Definition lsMakeGeometry.hpp:144
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsMakeGeometry.hpp:87
void setGeometry(SmartPointer< Sphere< T, D > > passedSphere)
Set sphere as geometry to be created in the level set.
Definition lsMakeGeometry.hpp:92
This class is used to mark points of the level set which are enclosed in a void.
Definition lsMarkVoidPoints.hpp:28
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsMarkVoidPoints.hpp:95
void setReverseVoidDetection(bool passedReverseVoidDetection)
Set whether the "top" level set should be the most positive(default) connected chain of level set val...
Definition lsMarkVoidPoints.hpp:103
void apply()
Definition lsMarkVoidPoints.hpp:154
void setSaveComponentIds(bool scid)
Set whether the connected component IDs used to generate the void points should be saved....
Definition lsMarkVoidPoints.hpp:150
void setDetectLargestSurface(bool passedDetect)
Set whether the number of points of one connected surface should be used to detect void points....
Definition lsMarkVoidPoints.hpp:113
void setVoidTopSurface(VoidTopSurfaceEnum topSurface)
Set which connected component to use as the top surface and mark all other components as void points.
Definition lsMarkVoidPoints.hpp:119
std::size_t getNumberOfComponents() const
Definition lsMarkVoidPoints.hpp:152
This class holds an explicit mesh, which is always given in 3 dimensions. If it describes a 2D mesh,...
Definition lsMesh.hpp:22
Class describing a plane via a point in it and the plane normal.
Definition lsGeometries.hpp:42
Class describing a point cloud, which can be used to create geometries from its convex hull mesh.
Definition lsGeometries.hpp:145
void insertNextPoint(T *newPoint)
Definition lsGeometries.hpp:154
Removes all level set points, which do not have at least one oppositely signed neighbour (Meaning the...
Definition lsPrune.hpp:17
void apply()
removes all grid points, which do not have at least one opposite signed neighbour returns the number ...
Definition lsPrune.hpp:74
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsPrune.hpp:59
Definition lsReader.hpp:13
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsReader.hpp:26
void apply()
Definition lsReader.hpp:35
void setFileName(std::string passedFileName)
set file name for file to write
Definition lsReader.hpp:31
Reduce the level set size to the specified width. This means all level set points with value <= 0....
Definition lsReduce.hpp:14
void apply()
Reduces the leveleSet to the specified number of layers. The largest value in the levelset is thus wi...
Definition lsReduce.hpp:55
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsReduce.hpp:32
void setWidth(int passedWidth)
Set which level set points should be kept. All points with a level set value >0.5*width will be remov...
Definition lsReduce.hpp:39
void setNoNewSegment(bool passedNoNewSegment)
Set whether to segment the level set after algorithm is finished. This means points will be evenly di...
Definition lsReduce.hpp:44
This algorithm can be used to remove all LS values which are not part of a so-called top surface....
Definition lsRemoveStrayPoints.hpp:17
void setVoidTopSurface(VoidTopSurfaceEnum topSurface)
Set how the algorithm should pick the surface which will not be removed. Defaults to the surface with...
Definition lsRemoveStrayPoints.hpp:33
void apply()
Definition lsRemoveStrayPoints.hpp:37
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsRemoveStrayPoints.hpp:27
Concrete implementation of GeometricAdvectDistribution for a spherical advection distribution.
Definition lsGeometricAdvectDistributions.hpp:50
bool isInside(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, double eps) const override
Quick check whether a point relative to the distributions center is inside the distribution....
Definition lsGeometricAdvectDistributions.hpp:60
std::array< viennahrle::CoordType, 6 > getBounds() const override
Sets bounds to the bounding box of the distribution.
Definition lsGeometricAdvectDistributions.hpp:110
T getSignedDistance(const Vec3D< viennahrle::CoordType > &initial, const Vec3D< viennahrle::CoordType > &candidate, unsigned long) const override
Returns the signed distance of a point relative to the distributions center. This is the signed manha...
Definition lsGeometricAdvectDistributions.hpp:75
Class describing a sphere via origin and radius.
Definition lsGeometries.hpp:15
This class creates a mesh from the level set with all grid points with a level set value <= 0....
Definition lsToDiskMesh.hpp:24
void clearLevelSets()
Definition lsToDiskMesh.hpp:83
void setMesh(SmartPointer< Mesh< N > > passedMesh)
Definition lsToDiskMesh.hpp:70
void setMaterialMap(SmartPointer< MaterialMap > passedMaterialMap)
Definition lsToDiskMesh.hpp:77
void apply()
Definition lsToDiskMesh.hpp:85
void insertNextLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Pushes the passed level set to the back of the list of level sets.
Definition lsToDiskMesh.hpp:66
void setMaxValue(const T passedMaxValue)
Definition lsToDiskMesh.hpp:81
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsToDiskMesh.hpp:61
Extract the regular grid, on which the level set values are defined, to an explicit Mesh<>....
Definition lsToMesh.hpp:19
void setOnlyDefined(bool passedOnlyDefined)
Definition lsToMesh.hpp:43
void setLevelSet(SmartPointer< Domain< T, D > > passedlsDomain)
Definition lsToMesh.hpp:37
void apply()
Definition lsToMesh.hpp:49
void setOnlyActive(bool passedOnlyActive)
Definition lsToMesh.hpp:47
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsToMesh.hpp:41
Definition lsToMultiSurfaceMesh.hpp:11
void apply() override
Definition lsToMultiSurfaceMesh.hpp:236
void setMaterialMap(SmartPointer< MaterialMap > passedMaterialMap)
Definition lsToMultiSurfaceMesh.hpp:232
void clearLevelSets()
Definition lsToMultiSurfaceMesh.hpp:230
void insertNextLevelSet(SmartPointer< lsDomainType > passedLevelSet)
Definition lsToMultiSurfaceMesh.hpp:226
Extract an explicit Mesh<> instance from an lsDomain. The interface is then described by explicit sur...
Definition lsToSurfaceMesh.hpp:25
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsToSurfaceMesh.hpp:95
void setUpdatePointData(bool update)
Definition lsToSurfaceMesh.hpp:97
void setSharpCorners(bool check)
Definition lsToSurfaceMesh.hpp:99
virtual void apply()
Definition lsToSurfaceMesh.hpp:101
void setLevelSet(SmartPointer< lsDomainType > passedlsDomain)
Definition lsToSurfaceMesh.hpp:90
Creates a mesh, which consists only of quads/hexas for completely filled grid cells in the level set....
Definition lsToVoxelMesh.hpp:20
void setMesh(SmartPointer< Mesh< T > > passedMesh)
Definition lsToVoxelMesh.hpp:76
void clearLevelSets()
Definition lsToVoxelMesh.hpp:74
void insertNextLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Push level set to the list of level sets used for output. If more than one are specified,...
Definition lsToVoxelMesh.hpp:70
void apply()
Definition lsToVoxelMesh.hpp:82
Abstract class defining the interface for the velocity field used during advection using lsAdvect.
Definition lsVelocityField.hpp:11
Definition lsWriter.hpp:13
void setFileName(std::string passedFileName)
set file name for file to write
Definition lsWriter.hpp:31
void setLevelSet(SmartPointer< Domain< T, D > > passedLevelSet)
Definition lsWriter.hpp:26
void apply()
Definition lsWriter.hpp:35
Definition lsAdvect.hpp:41
FeatureDetectionEnum
Definition lsDetectFeatures.hpp:16
BooleanOperationEnum
Enumeration for the different types of boolean operations which are supported. When INVERT,...
Definition lsBooleanOperation.hpp:27
CurvatureEnum
Definition lsCalculateCurvatures.hpp:15
void bindApi(py::module &module)
Definition pyWrap.hpp:91
PYBIND11_DECLARE_HOLDER_TYPE(TemplateType, SmartPointer< TemplateType >)