Skip to content

Commit 0241a8d

Browse files
committed
Transform: corr. consSmooth tests
1 parent 27bd612 commit 0241a8d

File tree

4 files changed

+30
-28
lines changed

4 files changed

+30
-28
lines changed

Cassiopee/Transform/Transform/consSmooth.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ inline E_Int stepCorrection(E_Int isOpen, E_Int nUnique)
3737
// Case of a CLOSED curve with an ODD number of points
3838
if ((isOpen == 0) && (nUnique % 2 != 0))
3939
{
40-
printf("WARNING: consSmooth: step=2 is invalid for closed curve with odd number of points. Forcing step=1.\n");
40+
printf("Warning: consSmooth: step=2 is invalid for closed curve with odd number of points. Forcing step=1.\n");
4141
return 1;
4242
}
4343

4444
// Case of an OPEN curve with an EVEN number of points
4545
if ((isOpen == 1) && (nUnique % 2 == 0))
4646
{
47-
printf("WARNING: consSmooth: step=2 is invalid for open curve with even number of points. Forcing step=1.\n");
47+
printf("Warning: consSmooth: step=2 is invalid for open curve with even number of points. Forcing step=1.\n");
4848
return 1;
4949
}
5050

@@ -139,16 +139,16 @@ PyObject* K_TRANSFORM::consSmooth(PyObject* self, PyObject* args)
139139

140140
if (isOpen)
141141
{
142-
printf("consSmooth: open geometry: fixed nodes %d and %d.\n", 0, npts-1);
142+
printf("Info: consSmooth: open geometry: fixed nodes %d and %d.\n", 0, npts-1);
143143
}
144144
{
145-
printf("consSmooth: closed geometry with double points");
145+
printf("Info: consSmooth: closed geometry with double points.\n");
146146
}
147147

148148

149149
E_Int nUnique = (isOpen == 0) ? npts - 1 : npts;
150150
E_Int start = 0;
151-
E_Int end = (isOpen == 0) ? nUnique : nUnique - 3;
151+
E_Int end = (isOpen == 0) ? nUnique : nUnique - 3;
152152

153153
// step 2 invalid for some cases, correction by taking step = 1
154154
if (step == 2)
@@ -166,7 +166,6 @@ PyObject* K_TRANSFORM::consSmooth(PyObject* self, PyObject* args)
166166
{
167167

168168
if (isOpen == 0)
169-
170169
{
171170
// Cycle, always in [0, nUnique-1]
172171
idx0 = (j == 0) ? i % nUnique : (nUnique - i % nUnique) % nUnique;
@@ -281,17 +280,17 @@ PyObject* K_TRANSFORM::consSmooth(PyObject* self, PyObject* args)
281280
if (isOpen == 0)
282281
{
283282
// CASE 2: mesh is topologically OPEN, but geometrically CLOSED.
284-
printf("consSmooth: closed geometry with double points: %d and %d.\n", n1, n2);
283+
printf("Info: consSmooth: closed geometry with double points: %d and %d.\n", n1, n2);
285284
}
286285
else // CASE 3: mesh is OPEN (extremities will stay fixed)
287286

288287
{
289-
printf("consSmooth: open geometry: fixed nodes %d and %d.\n", n1, n2);
288+
printf("Info: consSmooth: open geometry: fixed nodes %d and %d.\n", n1, n2);
290289
}
291290
}
292291
else
293292
{
294-
printf("consSmooth: closed geometry \n");
293+
printf("Info: consSmooth: closed geometry.\n");
295294
}
296295

297296
// Create a chained of ordered nodes
@@ -321,19 +320,19 @@ PyObject* K_TRANSFORM::consSmooth(PyObject* self, PyObject* args)
321320

322321
bar.push_back(next);
323322
prev = cur;
324-
cur = next;
323+
cur = next;
325324
if (isOpen == 1 && cur == n2) break; // we reach the end of opened curve
326325
}
327326

328327
E_Int nUnique = (E_Int)bar.size();
329328

330329
E_Int start = 0;
331-
E_Int end = (isOpen == 0) ? nUnique : nUnique - 3;
330+
E_Int end = (isOpen == 0) ? nUnique : nUnique - 3;
332331

333332
// step 2 invalid for some cases, correction by taking step = 1
334333
if (step == 2)
335334
{
336-
step = stepCorrection (isOpen, nUnique);
335+
step = stepCorrection(isOpen, nUnique);
337336
}
338337

339338
for (E_Int k = 0; k < sweeps; k++)

Cassiopee/Transform/test/consSmoothPT_t1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010
l3 = D.line((1.,1.,0.), (1.,0.,0.), N=5)
1111
l4 = D.line((1.,0.,0.), (0.,0.,0.), N=5)
1212

13-
# standard array1 tests on closed curve
13+
# struct 1D closed curve
1414
a = T.join([l1,l2,l3,l4])
1515
a = T.consSmooth(a, sweeps)
1616
test.testT(a, 1)
1717

18-
# standard array1 tests on open curve
18+
# struct 1D open curve
1919
b = T.join([l1,l2,l3])
2020
b = T.consSmooth(b, sweeps)
2121
test.testT(b, 2)
2222

23-
# standard bar1D tests on closed curve
23+
# bar1D closed curve
2424
c = C.convertArray2Tetra(a)
2525
c = T.consSmooth(c, sweeps)
2626
test.testT(c, 3)
2727

28-
# standard bar1D tests on open curve
28+
# bar1D open curve
2929
d = C.convertArray2Tetra(b)
3030
d = T.consSmooth(d, sweeps)
3131
test.testT(d, 4)

Cassiopee/Transform/test/consSmooth_t1.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,27 @@
55
import Converter as C
66

77
sweeps = 5
8-
l1 = D.line((0.,0.,0.), (0.,1.,0.), N=5+1)
8+
l1 = D.line((0.,0.,0.), (0.,1.,0.), N=5)
99
l2 = D.line((0.,1.,0.), (1.,1.,0.), N=5)
1010
l3 = D.line((1.,1.,0.), (1.,0.,0.), N=5)
1111
l4 = D.line((1.,0.,0.), (0.,0.,0.), N=5)
1212

13-
# standard array1 tests on closed curve
13+
# struct 1D closed curve
1414
a = T.join([l1,l2,l3,l4])
1515
a = T.consSmooth(a, sweeps)
1616
test.testA([a], 1)
1717

18-
# standard array1 tests on open curve
18+
# struct 1D open curve
1919
b = T.join([l1,l2,l3])
2020
b = T.consSmooth(b, sweeps)
2121
test.testA([b], 2)
2222

23-
# standard bar1D tests on closed curve
23+
# bar1D closed curve
2424
c = C.convertArray2Tetra(a)
25-
c = T.consSmooth(c, sweeps, 1,2)
25+
c = T.consSmooth(c, sweeps)
2626
test.testA([c], 3)
2727

28-
C.convertArrays2File(c, "out3.plt")
29-
30-
# standard bar1D tests on open curve
28+
# bar1D open curve
3129
d = C.convertArray2Tetra(b)
32-
d = T.consSmooth(d, sweeps, 1, 2)
33-
test.testA([d], 4)
34-
C.convertArrays2File(d, "out4.plt")
30+
d = T.consSmooth(d, sweeps)
31+
test.testA([d], 4)

docs/ReleaseNotes.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@
1515
<body>
1616
<h1>Release notes</h1>
1717

18+
1819
<HR><p>
19-
- All: release 4.1 (02/2026)<br>
20+
21+
- Converter: add _initBCDataSet.<br>
22+
23+
- Converter: move getFamilyBCs, getFamilyBCNamesOfType to Internal.<br>
24+
25+
- All: release 4.1 (02/2026).<br>
2026

2127
- Converter: FSDM format for ME (read/write).<br>
2228

0 commit comments

Comments
 (0)