Conversation
b9ec532 to
2f8adf9
Compare
|
@luciemac @finetjul @DavidBerger98 The |
d1bff5e to
a436863
Compare
28c5dea to
7b85be5
Compare
e4ca963 to
578e9d4
Compare
578e9d4 to
2ddcf2f
Compare
Translation from cpp implementation and add test to those functions Create functions as static functions and in publicAPI Fix pointInPolygon and triangulate to return the triangles Updated ts definition
2ddcf2f to
4584c83
Compare
WORK IN PROGRESS
| model.points.getPoint(idsToHandle[i], current); | ||
| const next = [0, 0, 0]; | ||
| model.points.getPoint( | ||
| toCorrectId(idsToHandle[toCorrectId(i + 1, idsToHandle.length)], numPts), |
There was a problem hiding this comment.
getPoint(
nextPoint(i, idsToHandle, numPts),
next
);
...
getPoint(
previousPoint(i, idsToHandle, numPts),
previous
);
| firstPoint: null, | ||
| pointCount: 0, | ||
| tris: [], | ||
| points: [], |
There was a problem hiding this comment.
model.points is actually defined in vtkCell as vtkPoints. I doubt it should be [] here
| publicAPI.setPoints = (points, pointsIds) => { | ||
| let pointsData = points; | ||
| if (Array.isArray(pointsData[0])) { | ||
| pointsData = points.flat(2); |
There was a problem hiding this comment.
shouldn't it be points.flat() instead?
| } else { | ||
| model.pointsIds = pointsIds; | ||
| } | ||
| publicAPI.computeNormal(); |
There was a problem hiding this comment.
should probably call modified()
| return idsToHandle.length <= 2 ? triangles : null; | ||
| } | ||
|
|
||
| publicAPI.computeNormal = () => getNormal(model.points, model.normal); |
There was a problem hiding this comment.
here you ignore model.pointIds, are you sure it is intended ?
Context
Translation of C++ functions of vtkPolygon.
Note: this PR is to be merged after PR #2532 as it uses functions implemented in the latter.
Results
Implementation of
Each of them are also exported as static functions.
Changes
The
computeNormalfunction has been replaced by the static functiongetNormalexported in the publicAPI ascomputeNormal.PR and Code Checklist
npm run reformatto have correctly formatted codeTesting