Skip to content

Commit

Permalink
opennurbs patches weren't working with system patch on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Feb 16, 2024
1 parent 0ccc807 commit 39b869f
Show file tree
Hide file tree
Showing 22 changed files with 1,919 additions and 1,921 deletions.
48 changes: 24 additions & 24 deletions opennurbs/opennurbs_brep_cpp.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
--- opennurbs/opennurbs_brep.cpp 2023-12-20 11:23:16.137987286 -0500
+++ OPENNURBS_BLD/opennurbs_brep.cpp 2023-12-20 11:22:15.331051837 -0500
--- opennurbs/opennurbs_brep.cpp 2024-02-16 13:44:43.176776155 -0500
+++ OPENNURBS_BLD/opennurbs_brep.cpp 2024-02-16 13:49:38.419887610 -0500
@@ -3578,6 +3578,10 @@
}
}

+ // BRL-CAD uses this for a tolerance check below
+ const ON_Surface *surf = loop.Face()->SurfaceOf();
+ double urange = (surf) ? (surf->Domain(0)[1] - surf->Domain(0)[0]) : DBL_MAX;
+ double vrange = (surf) ? (surf->Domain(1)[1] - surf->Domain(1)[0]) : DBL_MAX;

// make sure ends of trims jibe
int ci0, ci1, next_lti;
}
}

+ // BRL-CAD uses this for a tolerance check below
+ const ON_Surface *surf = loop.Face()->SurfaceOf();
+ double urange = (surf) ? (surf->Domain(0)[1] - surf->Domain(0)[0]) : DBL_MAX;
+ double vrange = (surf) ? (surf->Domain(1)[1] - surf->Domain(1)[0]) : DBL_MAX;

// make sure ends of trims jibe
int ci0, ci1, next_lti;
@@ -3606,6 +3610,12 @@
// didn't get flagged as bad.
double xtol = (fabs(P0.x) + fabs(P1.x))*1.0e-10;
double ytol = (fabs(P0.y) + fabs(P1.y))*1.0e-10;
+
+ // Oct 12 2009 Rather than using the above check, BRL-CAD uses
+ // relative uv size if it is available
+ xtol = (urange < DBL_MAX) ? urange * trim0.m_tolerance[0] : xtol;
+ ytol = (vrange < DBL_MAX) ? vrange * trim0.m_tolerance[1] : ytol;
+
if ( xtol < ON_ZERO_TOLERANCE )
xtol = ON_ZERO_TOLERANCE;
if ( ytol < ON_ZERO_TOLERANCE )
// didn't get flagged as bad.
double xtol = (fabs(P0.x) + fabs(P1.x))*1.0e-10;
double ytol = (fabs(P0.y) + fabs(P1.y))*1.0e-10;
+
+ // Oct 12 2009 Rather than using the above check, BRL-CAD uses
+ // relative uv size if it is available
+ xtol = (urange < DBL_MAX) ? urange * trim0.m_tolerance[0] : xtol;
+ ytol = (vrange < DBL_MAX) ? vrange * trim0.m_tolerance[1] : ytol;
+
if ( xtol < ON_ZERO_TOLERANCE )
xtol = ON_ZERO_TOLERANCE;
if ( ytol < ON_ZERO_TOLERANCE )
32 changes: 16 additions & 16 deletions opennurbs/opennurbs_brep_h.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
--- opennurbs/opennurbs_brep.h 2023-12-20 11:23:14.382018010 -0500
+++ OPENNURBS_BLD/opennurbs_brep.h 2023-12-20 11:22:19.090985982 -0500
--- opennurbs/opennurbs_brep.h 2024-02-16 13:44:43.176776155 -0500
+++ OPENNURBS_BLD/opennurbs_brep.h 2024-02-16 14:00:20.173055503 -0500
@@ -4141,6 +4141,7 @@
);

// helpers for validation checking
+public:
bool IsValidTrim(int trim_index,ON_TextLog* text_log) const;
bool IsValidTrimTopology(int trim_index,ON_TextLog* text_log) const;
bool IsValidTrimGeometry(int trim_index,ON_TextLog* text_log) const;
);

// helpers for validation checking
+public:
bool IsValidTrim(int trim_index,ON_TextLog* text_log) const;
bool IsValidTrimTopology(int trim_index,ON_TextLog* text_log) const;
bool IsValidTrimGeometry(int trim_index,ON_TextLog* text_log) const;
@@ -4166,6 +4167,7 @@
bool IsValidVertexGeometry(int vertex_index,ON_TextLog* text_log) const;
bool IsValidVertexTolerancesAndFlags(int vertex_index,ON_TextLog* text_log) const;

+protected:
void SetTolsFromLegacyValues();

// read helpers to support various versions
bool IsValidVertexGeometry(int vertex_index,ON_TextLog* text_log) const;
bool IsValidVertexTolerancesAndFlags(int vertex_index,ON_TextLog* text_log) const;

+protected:
void SetTolsFromLegacyValues();

// read helpers to support various versions
Loading

0 comments on commit 39b869f

Please sign in to comment.