Skip to content

Commit

Permalink
XCore: remove warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
imadhammani committed Nov 21, 2024
1 parent 8ec3bfa commit 5fb17a5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Cassiopee/XCore/XCore/intersectMesh/dcel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ void Dcel::triangulate(const Smesh &Mf, const Smesh &Sf)
std::vector<E_Int> non_convex_faces;

for (size_t fid = 0; fid < F.size(); fid++) {
Face *f = F[fid];
// TODO(Imad): skip single color faces

const auto &vertices = Fv[fid];
Expand Down Expand Up @@ -767,7 +766,7 @@ void Dcel::triangulate(const Smesh &Mf, const Smesh &Sf)
E_Int vid = 0;
do {
Vertex *v = current->v;
char fname[16] = {0};
char fname[128] = {0};
sprintf(fname, "vertex%d.im", vid);
point_write(fname, v->x, v->y, v->z);
current = current->next;
Expand Down
4 changes: 2 additions & 2 deletions Cassiopee/XCore/XCore/intersectMesh/dcel_reconstruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void Dcel::reconstruct(Smesh &Mf, int color) const

for (size_t i = 0; i < faces_to_keep.size(); i++) {
E_Int fid = faces_to_keep[i];
Face *f = F[fid];
//Face *f = F[fid];
const auto &vertices = Fv[fid];
for (size_t j = 0; j < vertices.size(); j++) {
Vertex *v = vertices[j];
Expand Down Expand Up @@ -71,7 +71,7 @@ void Dcel::reconstruct(Smesh &Mf, int color) const

// Add the rest of the children
for (size_t i = 1; i < children.size(); i++) {
Face *f = F[children[i]];
//Face *f = F[children[i]];
const auto &vertices = Fv[children[i]];
std::vector<E_Int> PN(vertices.size());
for (size_t j = 0; j < vertices.size(); j++) {
Expand Down
4 changes: 2 additions & 2 deletions Cassiopee/XCore/XCore/intersectMesh/icapsule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ PyObject *K_XCORE::icapsule_intersect(PyObject *self, PyObject *args)

for (size_t i = 0; i < Ss.size(); i++) {

printf("Intersecting slave %d\n", i);
printf("Intersecting slave %lu\n", i);

Mf.make_bbox();
Mf.hash_faces();
Expand Down Expand Up @@ -438,7 +438,7 @@ PyObject *K_XCORE::icapsule_intersect(PyObject *self, PyObject *args)

Dcel D = Dcel::intersect(Mf, Sf, plocs);

E_Int nf_before_intersect = Sf.nf;
//E_Int nf_before_intersect = Sf.nf;

D.reconstruct(Mf, Dcel::RED);
//Mf.write_ngon("Mf_after_intersect.im");
Expand Down
7 changes: 5 additions & 2 deletions Cassiopee/XCore/XCore/intersectMesh/smesh_locate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Point2D project_to_2D(Point3D point, const E_Float *N)
return projected;
}

#define MAX_PTS 100

bool Smesh::is_point_in_3D_polygon(E_Float x, E_Float y, E_Float z, E_Int fid) const
{
const auto &pn = Fc[fid];
Expand All @@ -44,8 +46,9 @@ bool Smesh::is_point_in_3D_polygon(E_Float x, E_Float y, E_Float z, E_Int fid) c
E_Float dp = fabs(K_MATH::dot(ap, fN, 3));
if (dp > TOL) return false;

Point2D projected_polygon[pn.size()];
for (int i = 0; i < pn.size(); i++) {
assert(pn.size() <= MAX_PTS);
Point2D projected_polygon[MAX_PTS];
for (size_t i = 0; i < pn.size(); i++) {
Point3D p = {X[pn[i]], Y[pn[i]], Z[pn[i]]};
projected_polygon[i] = project_to_2D(p, fN);
}
Expand Down

0 comments on commit 5fb17a5

Please sign in to comment.