Revision: 76842
http://sourceforge.net/p/brlcad/code/76842
Author: starseeker
Date: 2020-08-19 01:36:00 +0000 (Wed, 19 Aug 2020)
Log Message:
-----------
Rename to match the convention used by related functions in libbn (which need
to migrate to libbg)
Modified Paths:
--------------
brlcad/trunk/include/bg/lseg.h
brlcad/trunk/src/libbg/lseg_lseg.c
brlcad/trunk/src/libbg/lseg_pt.c
brlcad/trunk/src/libbg/tests/lseg_lseg.c
brlcad/trunk/src/libbg/tests/lseg_pt.c
brlcad/trunk/src/libbrep/opennurbs_ext.cpp
brlcad/trunk/src/libged/snap.c
Modified: brlcad/trunk/include/bg/lseg.h
===================================================================
--- brlcad/trunk/include/bg/lseg.h 2020-08-19 01:24:19 UTC (rev 76841)
+++ brlcad/trunk/include/bg/lseg.h 2020-08-19 01:36:00 UTC (rev 76842)
@@ -41,7 +41,7 @@
* question if c is non-NULL.
*/
BG_EXPORT double
-bg_lseg_pt_dist_sq(point_t *c, const point_t P0, const point_t P1, const
point_t Q);
+bg_distsq_lseg3_pt(point_t *c, const point_t P0, const point_t P1, const
point_t Q);
/* Compute the closest points on the line segments P0->P1 and Q0->Q1. Returns
* the distance squared between the closest points and (optionally) the closest
@@ -48,7 +48,7 @@
* points in question (c1 is the point on P0->P1, c2 is the point on Q0->Q1).
*/
BG_EXPORT double
-bg_lseg_lseg_dist_sq(point_t *c1, point_t *c2,
+bg_distsq_lseg3_lseg3(point_t *c1, point_t *c2,
const point_t P0, const point_t P1, const point_t Q0, const point_t Q1);
__END_DECLS
Modified: brlcad/trunk/src/libbg/lseg_lseg.c
===================================================================
--- brlcad/trunk/src/libbg/lseg_lseg.c 2020-08-19 01:24:19 UTC (rev 76841)
+++ brlcad/trunk/src/libbg/lseg_lseg.c 2020-08-19 01:36:00 UTC (rev 76842)
@@ -207,7 +207,7 @@
double
-bg_lseg_lseg_dist_sq(point_t *c1, point_t *c2,
+bg_distsq_lseg3_lseg3(point_t *c1, point_t *c2,
const point_t P0, const point_t P1, const point_t Q0, const
point_t Q1)
{
vect_t diff, r1a, r1b, r2a, r2b, r1, r2;
Modified: brlcad/trunk/src/libbg/lseg_pt.c
===================================================================
--- brlcad/trunk/src/libbg/lseg_pt.c 2020-08-19 01:24:19 UTC (rev 76841)
+++ brlcad/trunk/src/libbg/lseg_pt.c 2020-08-19 01:36:00 UTC (rev 76842)
@@ -14,7 +14,7 @@
#include "bg/lseg.h"
double
-bg_lseg_pt_dist_sq(point_t *c, const point_t P0, const point_t P1, const
point_t Q)
+bg_distsq_lseg3_pt(point_t *c, const point_t P0, const point_t P1, const
point_t Q)
{
double ldist_sq, parameter;
vect_t closest, dir, diff;
Modified: brlcad/trunk/src/libbg/tests/lseg_lseg.c
===================================================================
--- brlcad/trunk/src/libbg/tests/lseg_lseg.c 2020-08-19 01:24:19 UTC (rev
76841)
+++ brlcad/trunk/src/libbg/tests/lseg_lseg.c 2020-08-19 01:36:00 UTC (rev
76842)
@@ -48,7 +48,7 @@
VSET(Q0, 3.44524589136147830,7.67444957869714628,22.91984784277452647);
VSET(Q1, 3.56555225936148323,7.98564760063074353,23.37334866995422900);
- dist = sqrt(bg_lseg_lseg_dist_sq(&c0, &c1, P0, P1, Q0, Q1));
+ dist = sqrt(bg_distsq_lseg3_lseg3(&c0, &c1, P0, P1, Q0, Q1));
if (dist < 0) {
bu_exit(-1, "Fatal error - mesh validity test failed\n");
Modified: brlcad/trunk/src/libbg/tests/lseg_pt.c
===================================================================
--- brlcad/trunk/src/libbg/tests/lseg_pt.c 2020-08-19 01:24:19 UTC (rev
76841)
+++ brlcad/trunk/src/libbg/tests/lseg_pt.c 2020-08-19 01:36:00 UTC (rev
76842)
@@ -46,7 +46,7 @@
sscanf(argv[4], "%lf,%lf,%lf", &E[X], &E[Y], &E[Z]);
sscanf(argv[5], "%lf", &edist);
- cdist = sqrt(bg_lseg_pt_dist_sq(&C, P0, P1, Q));
+ cdist = sqrt(bg_distsq_lseg3_pt(&C, P0, P1, Q));
if (!NEAR_EQUAL(edist, cdist, DCHECK_TOL)) {
bu_log("expected %g, got %g\n", edist, cdist);
Modified: brlcad/trunk/src/libbrep/opennurbs_ext.cpp
===================================================================
--- brlcad/trunk/src/libbrep/opennurbs_ext.cpp 2020-08-19 01:24:19 UTC (rev
76841)
+++ brlcad/trunk/src/libbrep/opennurbs_ext.cpp 2020-08-19 01:36:00 UTC (rev
76842)
@@ -368,7 +368,7 @@
double ndist;
if (t) {
point_t c1i, l1i;
- ndist = sqrt(bg_lseg_lseg_dist_sq(&c1i, &l1i, C0, C1, L0, L1));
+ ndist = sqrt(bg_distsq_lseg3_lseg3(&c1i, &l1i, C0, C1, L0, L1));
double nt;
ON_3dPoint tp(c1i[0], c1i[1], c1i[2]);
if (!ON_NurbsCurve_GetClosestPoint(&nt, nc, tp, maximum_distance,
&domain)) {
@@ -380,7 +380,7 @@
}
(*t) = nt;
} else {
- ndist = sqrt(bg_lseg_lseg_dist_sq(NULL, NULL, C0, C1, L0, L1));
+ ndist = sqrt(bg_distsq_lseg3_lseg3(NULL, NULL, C0, C1, L0, L1));
}
if (dist) {
(*dist) = ndist;
Modified: brlcad/trunk/src/libged/snap.c
===================================================================
--- brlcad/trunk/src/libged/snap.c 2020-08-19 01:24:19 UTC (rev 76841)
+++ brlcad/trunk/src/libged/snap.c 2020-08-19 01:36:00 UTC (rev 76842)
@@ -72,7 +72,7 @@
point_t c;
VMOVE(P0, lines->gdls_points[i]);
VMOVE(P1, lines->gdls_points[i+1]);
- double dsq = bg_lseg_pt_dist_sq(&c, P0, P1, *p);
+ double dsq = bg_distsq_lseg3_pt(&c, P0, P1, *p);
// If we're outside tolerance, continue
if (dsq > s->ctol_sq) {
continue;
@@ -119,7 +119,7 @@
VMOVE(Q0, s->c_lset2->gdls_points[s->c_l2]);
VMOVE(Q1, s->c_lset2->gdls_points[s->c_l2+1]);
- double csdist_sq = bg_lseg_lseg_dist_sq(&c1, &c2, P0, P1, Q0, Q1);
+ double csdist_sq = bg_distsq_lseg3_lseg3(&c1, &c2, P0, P1, Q0, Q1);
if (csdist_sq > s->ctol_sq) {
// Line segments are too far away to use both of them to override the
// original answer
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits