Skip to content

Commit

Permalink
Merge pull request Kitware#2050 from Nikhil216/fix-closedPolyLineToSu…
Browse files Browse the repository at this point in the history
…rfaceFilter

Fix closed poly line to surface filter
  • Loading branch information
finetjul authored Sep 6, 2021
2 parents 6b7998b + 4cf60b1 commit ecc7ead
Show file tree
Hide file tree
Showing 5 changed files with 986 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/Filters/General/ClosedPolyLineToSurfaceFilter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SegmentAgregator {
}
} else {
for (let i = 1; i < segment.length - 1; i++) {
seg.push(segment[segment.length - 1 - i]);
seg.unshift(segment[segment.length - 1 - i]);
}
}

Expand Down Expand Up @@ -72,7 +72,7 @@ class SegmentAgregator {
// our segment should be reverted and put on the front of the existing one
const seg = this.segments[-mappingFirst];
// record new head
this.segmentMapping[last] = -mappingFirst;
this.segmentMapping[last] = mappingFirst;

for (let i = 1; i < segment.length; i++) {
seg.unshift(segment[i]);
Expand All @@ -94,7 +94,7 @@ class SegmentAgregator {
const seg = this.segments[-mappingLast];

// record new head
this.segmentMapping[first] = -mappingLast;
this.segmentMapping[first] = mappingLast;

for (let i = 1; i < segment.length; i++) {
seg.unshift(segment[segment.length - i - 1]);
Expand Down Expand Up @@ -125,14 +125,14 @@ function vtkClosedPolyLineToSurfaceFilter(publicAPI, model) {
publicAPI.requestData = (inData, outData) => {
// implement requestData
const input = inData[0];
const output = vtkPolyData.newInstance();
output.shallowCopy(input);

if (!input) {
vtkErrorMacro('Invalid or missing input');
return;
}

const output = vtkPolyData.newInstance();
output.shallowCopy(input);

// Extract faces
const agregator = new SegmentAgregator();
const lines = input.getLines().getData();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"classHierarchy": [
"vtkObject",
"vtkDataArray",
"vtkCellArray"
],
"dataType": "Uint16Array",
"empty": true,
"name": "faces",
"numberOfComponents": 1,
"rangeTuple": [
0,
0
],
"size": 97,
"values": [
96,
43,
42,
8,
7,
6,
93,
2,
0,
1,
89,
90,
91,
92,
77,
78,
79,
80,
81,
82,
85,
83,
84,
86,
87,
67,
65,
66,
68,
69,
70,
71,
74,
72,
73,
75,
76,
5,
3,
4,
62,
54,
53,
52,
51,
49,
50,
63,
64,
17,
15,
16,
55,
56,
57,
14,
12,
13,
58,
59,
60,
61,
46,
45,
44,
30,
29,
28,
27,
25,
26,
47,
48,
24,
22,
23,
21,
19,
20,
38,
36,
37,
39,
40,
41,
35,
34,
31,
32,
33,
18,
11,
9,
10,
88,
94,
95
],
"vtkClass": "vtkCellArray"
}
Loading

0 comments on commit ecc7ead

Please # to comment.