|
From: <kin...@us...> - 2024-07-16 18:50:23
|
Revision: 7208
http://sourceforge.net/p/teem/code/7208
Author: kindlmann
Date: 2024-07-16 18:50:21 +0000 (Tue, 16 Jul 2024)
Log Message:
-----------
still debugging
Modified Paths:
--------------
teem/trunk/src/limn/lpu_cbfit.c
teem/trunk/src/limn/splineFit.c
teem/trunk/src/limn/test/03-single.sh
teem/trunk/src/limn/test/05-go.sh
Modified: teem/trunk/src/limn/lpu_cbfit.c
===================================================================
--- teem/trunk/src/limn/lpu_cbfit.c 2024-07-12 19:23:37 UTC (rev 7207)
+++ teem/trunk/src/limn/lpu_cbfit.c 2024-07-16 18:50:21 UTC (rev 7208)
@@ -262,13 +262,14 @@
airMopAdd(mop, xy, airFree, airMopAlways);
if (2 == size0) {
unsigned int ci;
- printf("%s: synthetically sampling single spline with %u points\n", me, synthNum);
+ fprintf(stderr, "%s: synthetically sampling single spline with %u points\n", me,
+ synthNum);
for (ci = 0; ci < 8; ci++) {
seg.xy[ci] = cpt[ci];
}
- printf("%s: synth seg: (%g,%g) -- (%g,%g) -- (%g,%g) -- (%g,%g)\n", me, seg.xy[0],
- seg.xy[1], seg.xy[2], seg.xy[3], seg.xy[4], seg.xy[5], seg.xy[6],
- seg.xy[7]);
+ fprintf(stderr, "%s: synth seg: (%g,%g) -- (%g,%g) -- (%g,%g) -- (%g,%g)\n", me,
+ seg.xy[0], seg.xy[1], seg.xy[2], seg.xy[3], seg.xy[4], seg.xy[5],
+ seg.xy[6], seg.xy[7]);
for (ii = 0; ii < synthNum; ii++) {
double uu = AIR_AFFINE(0, ii, synthNum - 1, 0, 1);
uu = pow(uu, synthPow);
@@ -278,8 +279,8 @@
unsigned int ci, si;
limnCbfPath *spath = limnCbfPathNew(size1);
airMopAdd(mop, spath, (airMopper)limnCbfPathNix, airMopAlways);
- printf("%s: synthetically sampling %u splines with %u points\n", me, size1,
- synthNum);
+ fprintf(stderr, "%s: synthetically sampling %u splines with %u points\n", me,
+ size1, synthNum);
/* copy in control point data */
for (si = 0; si < size1; si++) {
for (ci = 0; ci < 8; ci++) {
@@ -435,6 +436,7 @@
getchar();
}
+ fprintf(stderr, "%s: calling limnCbfGo (verbose=%d)\n", me, fctx->verbose);
if (limnCbfGo(path, fctx, lpnt)) {
airMopAdd(mop, err = biffGetDone(LIMN), airFree, airMopAlways);
fprintf(stderr, "%s: trouble doing fitting:\n%s", me, err);
Modified: teem/trunk/src/limn/splineFit.c
===================================================================
--- teem/trunk/src/limn/splineFit.c 2024-07-12 19:23:37 UTC (rev 7207)
+++ teem/trunk/src/limn/splineFit.c 2024-07-16 18:50:21 UTC (rev 7208)
@@ -1717,9 +1717,10 @@
od = fctx->ctvt + 6 * ci;
ELL_6V_COPY(od, id);
if (fctx->verbose) {
- printf(" corner %u is vertex %u\n"
+ printf(" corner %u is vertex %u%s\n"
" T,V,T = (%g,%g) (%g,%g) (%g,%g)\n",
- ci, vi, od[0], od[1], od[2], od[3], od[4], od[5]);
+ ci, vi, vi == pnum - 1 ? " (last vert)" : "", od[0], od[1], od[2],
+ od[3], od[4], od[5]);
}
ci++;
}
@@ -1773,10 +1774,11 @@
/* first try fitting a single spline */
if (fctx->verbose) {
- printf("%s[%u,%u]_%u: trying single fit on all points\n", me, loi, hii, recDepth);
+ printf("%s[%u,%u]_%u: trying initial fitSingle on all points\n", me, loi, hii,
+ recDepth);
}
if (fitSingle(alpha, V0, T1, T2, V3, fctx, lpnt, loi, hii)) {
- biffAddf(LIMN, "%s: fitSingle failed", me);
+ biffAddf(LIMN, "%s: initial fitSingle failed", me);
return 1;
}
if (fctx->distBig <= 1) {
Modified: teem/trunk/src/limn/test/03-single.sh
===================================================================
--- teem/trunk/src/limn/test/03-single.sh 2024-07-12 19:23:37 UTC (rev 7207)
+++ teem/trunk/src/limn/test/03-single.sh 2024-07-16 18:50:21 UTC (rev 7208)
@@ -44,16 +44,25 @@
#echo "-0.5 0.5
# 2.0 0.5
#-0.5 0.0
-# 0.5 -0.5" | unu 2op x - 1 | unu 2op + - 0.0 | ./lpu cbfit -i - -synthn $N -sup 1 -syntho xy-inn-$N.txt
+# 0.5 -0.5" |./lpu cbfit -i - -synthn $N -sup 1 -syntho xy-inn-$N.txt
+## This is demo of why we might want a step that optimizes tangent directions
+## after the parameterization has been found
+#N=42
+#echo "-1 -1
+# 1 1.5
+#-1 1.5
+# 1 -1" | ./lpu cbfit -i - -synthn $N -sup 3 -syntho xy-inn-$N.txt
+#junk xy-inn-$N.txt
+
# This is demo of why we might want a step that optimizes tangent directions
# after the parameterization has been found
-N=42
-echo "-1 -1
- 1 1.5
--1 1.5
- 1 -1" | unu 2op x - 1 | unu 2op + - 0.0 | ./lpu cbfit -i - -synthn $N -sup 3 -syntho xy-inn-$N.txt
-junk xy-inn-$N.txt
+N=60
+echo "1 -1
+ 1 3
+-3 -1
+ 1 -1" | ./lpu cbfit -i - -synthn $N -v 0 -syntho - | unu crop -min 0 0 -max M M-1 -o xy-inn-$N.txt
+# junk xy-inn-$N.txt
CMD="./lpu cbfit -i xy-inn-$N.txt -scl 0 -fs 0 -1 -v 1 -psi 1000000000 -nim 4000 -deltathr 0.000000000001"
echo "====== $CMD"
Modified: teem/trunk/src/limn/test/05-go.sh
===================================================================
--- teem/trunk/src/limn/test/05-go.sh 2024-07-12 19:23:37 UTC (rev 7207)
+++ teem/trunk/src/limn/test/05-go.sh 2024-07-16 18:50:21 UTC (rev 7208)
@@ -33,11 +33,12 @@
# https://devmanual.gentoo.org/tools-reference/bash/
unset UNRRDU_QUIET_QUIT
+if false; then
N=199
echo "-1 -1
-1 1
- 1 1
- 0 0" | ./lpu cbfit -i - -synthn $N -syntho 0.txt
+1 1
+0 0" | ./lpu cbfit -i - -synthn $N -syntho 0.txt
echo "0 0
-0.5 -0.5
1 -1
@@ -44,12 +45,14 @@
1 1" | ./lpu cbfit -i - -synthn $N -syntho 1.txt
cat 0.txt 1.txt | uniq > xy-inn.txt
junk {0,1}.txt xy-inn.txt
+IN=xy-inn.txt
+fi
-IN=xy-inn.txt
+IN=xy-inn-60.txt
#IN=pointy.txt
#IN=circ.txt
-CMD="./lpu cbfit -i $IN -scl 0.5 -v 0 -psi 3 -eps 0.003 -roll 0"
+CMD="./lpu cbfit -i $IN -loop -scl 0.5 -v 3 -psi 3 -eps 0.01 -roll 1"
echo "====== $CMD"
eval $CMD > log.txt
cat log.txt # ; junk log.txt
@@ -58,7 +61,7 @@
echo "====== RESULTS: --> $OUT"
grep "^seg" log.txt | xargs -n 12 echo | cut -d' ' -f 2,3,4,5,6,7,8,9
grep "^seg" log.txt | xargs -n 12 echo | cut -d' ' -f 2,3,4,5,6,7,8,9 |
- ./lpu cbfit -i - -synthn $((5*N)) -sup 1 -syntho $OUT
+ ./lpu cbfit -i - -loop -synthn 300 -sup 1 -syntho $OUT
junk $OUT
BIN=900
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|