[brlcad-commits] SF.net SVN: brlcad:[74891] brlcad/trunk/src/conv/step/util/CMakeLists.txt
Revision: 74891 http://sourceforge.net/p/brlcad/code/74891 Author: starseeker Date: 2020-02-12 01:33:52 + (Wed, 12 Feb 2020) Log Message: --- fix distcheck Modified Paths: -- brlcad/trunk/src/conv/step/util/CMakeLists.txt Modified: brlcad/trunk/src/conv/step/util/CMakeLists.txt === --- brlcad/trunk/src/conv/step/util/CMakeLists.txt 2020-02-11 13:46:40 UTC (rev 74890) +++ brlcad/trunk/src/conv/step/util/CMakeLists.txt 2020-02-12 01:33:52 UTC (rev 74891) @@ -28,6 +28,8 @@ set_target_properties(list_elements PROPERTIES COMPILE_DEFINITIONS "${gstep_IMPORTS}") endif(MSVC) +CMAKEFILES(CMakeLists.txt) + # Local Variables: # tab-width: 8 # mode: cmake This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ___ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits
[brlcad-commits] SF.net SVN: brlcad:[74887] brlcad/trunk
Revision: 74887 http://sourceforge.net/p/brlcad/code/74887 Author: brlcad Date: 2020-02-11 08:15:26 + (Tue, 11 Feb 2020) Log Message: --- fix mismatched declaration constness on get_closest_point(), make face a const ref too. Modified Paths: -- brlcad/trunk/include/brep/pullback.h brlcad/trunk/src/libbrep/opennurbs_ext.cpp Modified: brlcad/trunk/include/brep/pullback.h === --- brlcad/trunk/include/brep/pullback.h2020-02-10 20:25:49 UTC (rev 74886) +++ brlcad/trunk/include/brep/pullback.h2020-02-11 08:15:26 UTC (rev 74887) @@ -92,10 +92,10 @@ * -- minimum occurs when the gradient is zero, i.e. * \f[ \nabla f(u, v) = |\vec{S}(u, v)-\vec{p}|^2 = 0 \f] */ -BREP_EXPORT bool get_closest_point(ON_2dPoint , - ON_BrepFace *face, - const ON_3dPoint , - SurfaceTree *tree = NULL, +BREP_EXPORT bool get_closest_point(ON_2dPoint& outpt, + const ON_BrepFace& face, + const ON_3dPoint& point, + const SurfaceTree* tree = NULL, double tolerance = BREP_FCP_ROOT_EPSILON); /** Modified: brlcad/trunk/src/libbrep/opennurbs_ext.cpp === --- brlcad/trunk/src/libbrep/opennurbs_ext.cpp 2020-02-10 20:25:49 UTC (rev 74886) +++ brlcad/trunk/src/libbrep/opennurbs_ext.cpp 2020-02-11 08:15:26 UTC (rev 74887) @@ -1965,7 +1965,7 @@ bool get_closest_point(ON_2dPoint& outpt, - const ON_BrepFace* face, + const ON_BrepFace& face, const ON_3dPoint& point, const SurfaceTree* tree, double tolerance) @@ -1977,7 +1977,7 @@ pt2d_t curr_grad = {0.0, 0.0}; pt2d_t new_uv = {0.0, 0.0}; GCPData data; -data.surf = face->SurfaceOf(); +data.surf = face.SurfaceOf(); data.pt = point; TRACE("get_closest_point: " << PT(point)); @@ -1985,7 +1985,7 @@ // get initial estimate const SurfaceTree* a_tree = tree; if (a_tree == NULL) { - a_tree = new SurfaceTree(face); + a_tree = new SurfaceTree(); delete_tree = true; } ON_Interval u, v; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ___ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits
[brlcad-commits] SF.net SVN: brlcad:[74889] brlcad/trunk/src/librt/primitives/brep/brep.cpp
Revision: 74889 http://sourceforge.net/p/brlcad/code/74889 Author: brlcad Date: 2020-02-11 08:59:47 + (Tue, 11 Feb 2020) Log Message: --- this is still no bueno, but seems to show we are successfully walking towards the right point (despite 'inverse failed' blather) Modified Paths: -- brlcad/trunk/src/librt/primitives/brep/brep.cpp Modified: brlcad/trunk/src/librt/primitives/brep/brep.cpp === --- brlcad/trunk/src/librt/primitives/brep/brep.cpp 2020-02-11 08:32:23 UTC (rev 74888) +++ brlcad/trunk/src/librt/primitives/brep/brep.cpp 2020-02-11 08:59:47 UTC (rev 74889) @@ -1003,15 +1003,15 @@ ON_3dPoint p = surf->PointAt(uvpt[0], uvpt[1]); double dist_to_surf = p.DistanceTo(los_pnt); -const int MAX_ITERATIONS = 10; +const int MAX_ITERATIONS = 1000; const double stepsize = bs.plate_mode_thickness * 0.1; int iterations = 0; while (!NEAR_EQUAL(dist_to_surf, bs.plate_mode_thickness, stepsize) && iterations++ < MAX_ITERATIONS) { if (dist_to_surf > bs.plate_mode_thickness) - los -= stepsize; /* nudge back a full step */ + los -= (stepsize * 4.0); /* nudge back -400% step */ else if (dist_to_surf < bs.plate_mode_thickness) - los += (stepsize * 0.9); /* nudge forward 90% step */ + los += (stepsize * 0.4); /* nudge forward 40% step */ /* calculate a new exit point distance to surface */ VJOIN1(hp, ray.r_pt, hit.dist + los, ray.r_dir); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ___ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits
[brlcad-commits] SF.net SVN: brlcad:[74888] brlcad/trunk/src/librt/primitives/brep/brep.cpp
Revision: 74888 http://sourceforge.net/p/brlcad/code/74888 Author: brlcad Date: 2020-02-11 08:32:23 + (Tue, 11 Feb 2020) Log Message: --- implement a basic adjustment for platemode to clamp the thickness to within a platemode thickness distance from the surface. this is not final form, but is working surprisingly as intended. using an overly simple and inefficient stepping method to walk the los thickness back; needs newton's method or more aggressive stepping. Modified Paths: -- brlcad/trunk/src/librt/primitives/brep/brep.cpp Modified: brlcad/trunk/src/librt/primitives/brep/brep.cpp === --- brlcad/trunk/src/librt/primitives/brep/brep.cpp 2020-02-11 08:15:26 UTC (rev 74887) +++ brlcad/trunk/src/librt/primitives/brep/brep.cpp 2020-02-11 08:32:23 UTC (rev 74888) @@ -980,12 +980,45 @@ brep_platemode_thickness(const struct xray& ray, const brep_hit& hit, const struct brep_specific& bs) { double los = bs.plate_mode_thickness; +if (bs.plate_mode_nocos) { + return los; +} -if (!bs.plate_mode_nocos) { +double dot = fabs(VDOT(hit.normal, ray.r_dir)); +los = los / dot; - double dot = fabs(VDOT(hit.normal, ray.r_dir)); - los = los / dot; +point_t hp; +VJOIN1(hp, ray.r_pt, hit.dist + los, ray.r_dir); +ON_3dPoint los_pnt(V3ARGS(hp)); +/* try to make sure we don't extend more than plate-mode thickness + * beyond the surface by calculating the proposed exit point's + * distance to the surface. + */ +const ON_Surface* surf = hit.face.SurfaceOf(); +const ON_BrepFace& face = hit.face; +SurfaceTree* tree = NULL; +ON_2dPoint uvpt; +get_closest_point(uvpt, face, los_pnt, tree); +ON_3dPoint p = surf->PointAt(uvpt[0], uvpt[1]); +double dist_to_surf = p.DistanceTo(los_pnt); + +const int MAX_ITERATIONS = 10; +const double stepsize = bs.plate_mode_thickness * 0.1; +int iterations = 0; +while (!NEAR_EQUAL(dist_to_surf, bs.plate_mode_thickness, stepsize) && iterations++ < MAX_ITERATIONS) { + + if (dist_to_surf > bs.plate_mode_thickness) + los -= stepsize; /* nudge back a full step */ + else if (dist_to_surf < bs.plate_mode_thickness) + los += (stepsize * 0.9); /* nudge forward 90% step */ + + /* calculate a new exit point distance to surface */ + VJOIN1(hp, ray.r_pt, hit.dist + los, ray.r_dir); + los_pnt = ON_3dPoint(V3ARGS(hp)); + get_closest_point(uvpt, face, los_pnt, tree); + p = surf->PointAt(uvpt[0], uvpt[1]); + dist_to_surf = p.DistanceTo(los_pnt); } return los; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ___ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits
[brlcad-commits] SF.net SVN: brlcad:[74890] brlcad/trunk
Revision: 74890 http://sourceforge.net/p/brlcad/code/74890 Author: starseeker Date: 2020-02-11 13:46:40 + (Tue, 11 Feb 2020) Log Message: --- Don't overload debug_mode for color randomization - just add a purpose specific option var. Modified Paths: -- brlcad/trunk/include/gcv/api.h brlcad/trunk/src/conv/3dm/3dm-g.c brlcad/trunk/src/libgcv/plugins/rhino/rhino_read.cpp Modified: brlcad/trunk/include/gcv/api.h === --- brlcad/trunk/include/gcv/api.h 2020-02-11 08:59:47 UTC (rev 74889) +++ brlcad/trunk/include/gcv/api.h 2020-02-11 13:46:40 UTC (rev 74890) @@ -116,6 +116,9 @@ /* objects to convert */ const char * const *object_names; + +/* Apply color randomization */ +unsigned randomize_colors; }; Modified: brlcad/trunk/src/conv/3dm/3dm-g.c === --- brlcad/trunk/src/conv/3dm/3dm-g.c 2020-02-11 08:59:47 UTC (rev 74889) +++ brlcad/trunk/src/conv/3dm/3dm-g.c 2020-02-11 13:46:40 UTC (rev 74890) @@ -75,7 +75,7 @@ break; case 'r': - gcv_options.debug_mode = 1; + gcv_options.randomize_colors = 1; break; case 'v': Modified: brlcad/trunk/src/libgcv/plugins/rhino/rhino_read.cpp === --- brlcad/trunk/src/libgcv/plugins/rhino/rhino_read.cpp2020-02-11 08:59:47 UTC (rev 74889) +++ brlcad/trunk/src/libgcv/plugins/rhino/rhino_read.cpp2020-02-11 13:46:40 UTC (rev 74890) @@ -726,10 +726,11 @@ for (BU_PTBL_FOR(entry, (directory **), )) { comb_to_region(db, (*entry)->d_namep); - if (gcv_options.debug_mode) { - // random colors debug mode: TODO: move this into a filter after 7.26.0 + if (gcv_options.randomize_colors) { + // random colors mode: TODO: move this into a filter after 7.26.0 std::string rgb; + // TODO - use bu_color for this... for (std::size_t i = 0; i < 3; ++i) rgb.append(lexical_cast(static_cast (drand48() * 255.0 + 0.5)) + (i != 2 ? "/" : "")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ___ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits