App: move from float to double for accuracy parameter, add a virtual method to determine a default accuracy

This commit is contained in:
wmayer
2022-09-15 09:52:14 +02:00
parent 12e2985bf3
commit 1309b86ea5
13 changed files with 46 additions and 41 deletions

View File

@@ -140,10 +140,10 @@ void MeshObject::getFacesFromSubElement(const Data::Segment* element,
const MeshSegment* segm = static_cast<const MeshSegment*>(element);
if (segm->segment) {
Base::Reference<MeshObject> submesh(segm->mesh->meshFromSegment(segm->segment->getIndices()));
submesh->getFaces(points, faces, 0.0f);
submesh->getFaces(points, faces, 0.0);
}
else {
segm->mesh->getFaces(points, faces, 0.0f);
segm->mesh->getFaces(points, faces, 0.0);
}
}
}
@@ -309,7 +309,7 @@ MeshPoint MeshObject::getMeshPoint(PointIndex index) const
void MeshObject::getPoints(std::vector<Base::Vector3d> &Points,
std::vector<Base::Vector3d> &Normals,
float /*Accuracy*/, uint16_t /*flags*/) const
double /*Accuracy*/, uint16_t /*flags*/) const
{
Points = transformPointsToOutside(_kernel.GetPoints());
MeshCore::MeshRefNormalToPoints ptNormals(_kernel);
@@ -323,7 +323,7 @@ Mesh::Facet MeshObject::getMeshFacet(FacetIndex index) const
}
void MeshObject::getFaces(std::vector<Base::Vector3d> &Points,std::vector<Facet> &Topo,
float /*Accuracy*/, uint16_t /*flags*/) const
double /*Accuracy*/, uint16_t /*flags*/) const
{
unsigned long ctpoints = _kernel.CountPoints();
Points.reserve(ctpoints);

View File

@@ -150,9 +150,9 @@ public:
/** Get points from object with given accuracy */
void getPoints(std::vector<Base::Vector3d> &Points,
std::vector<Base::Vector3d> &Normals,
float Accuracy, uint16_t flags=0) const override;
double Accuracy, uint16_t flags=0) const override;
void getFaces(std::vector<Base::Vector3d> &Points,std::vector<Facet> &Topo,
float Accuracy, uint16_t flags=0) const override;
double Accuracy, uint16_t flags=0) const override;
std::vector<PointIndex> getPointsFromFacets(const std::vector<FacetIndex>& facets) const;
bool nearestFacetOnRay(const TRay& ray, double maxAngle, TFaceSection& output) const;
std::vector<TFaceSection> foraminate(const TRay& ray, double maxAngle) const;

View File

@@ -2050,7 +2050,7 @@ Py::Tuple MeshPy::getTopology() const
{
std::vector<Base::Vector3d> Points;
std::vector<Data::ComplexGeoData::Facet> Facets;
getMeshObjectPtr()->getFaces(Points, Facets, 0.0f);
getMeshObjectPtr()->getFaces(Points, Facets, 0.0);
Py::Tuple tuple(2);
Py::List vertex;
for (std::vector<Base::Vector3d>::const_iterator it = Points.begin();