MCPcopy Create free account
hub / github.com/SimVascular/SimVascular / Geom_reduce

Function Geom_reduce

Code/Source/PythonAPI/Geometry_PyModule.cxx:759–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757");
758
759static PyObject *
760Geom_reduce(PyObject* self, PyObject* args)
761{
762 auto api = PyUtilApiFunction("ssd", PyRunTimeErr, __func__);
763 char *srcName;
764 char *dstName;
765 double tol;
766
767 if (!PyArg_ParseTuple(args, api.format, &srcName, &dstName, &tol)) {
768 return api.argsError();
769 }
770
771 // Retrieve source object.
772 auto src = GetRepositoryGeometry(api, srcName);
773 if (src == NULL) {
774 return nullptr;
775 }
776
777 // Check that the repository dstName object does not already exist.
778 if (RepositoryGeometryExists(api, dstName)) {
779 return nullptr;
780 }
781
782 cvPolyData *dst;
783 if (sys_geom_Reduce(src, tol, &dst) != SV_OK) {
784 api.error("Error merging points for geometry '" + std::string(srcName) + ".");
785 return nullptr;
786 }
787
788 if (!AddGeometryToRepository(api, dstName, dst)) {
789 return nullptr;
790 }
791
792 return Py_BuildValue("s",dst->GetName());
793}
794
795//------------
796// Geom_union

Callers

nothing calls this directly

Calls 4

sys_geom_ReduceFunction · 0.85
argsErrorMethod · 0.80
errorMethod · 0.80
GetNameMethod · 0.80

Tested by

no test coverage detected