Hi,
I use vtk.js where I show how one object will be in the stone with inclusions.
I have two ply actors. One actor will be in second 100%. I want to cut all what not inside second actor?
Is it possible?
Mb, possible convert polygons to planes?
I have a situation where I can’t get input connection - it is null
stoneInfo.mesh.forEach((meshItem) => {
const filter = vtkClipClosedSurface.newInstance({
clippingPlanes:[] // where to get it from another actor?
});
const mapper = meshItem.getMapper()
filter.setInputConnection(mapper?.getInputConnection() as vtkPipelineConnection);
filter.setScalarModeToNone();
filter.update();
const filterData = filter.getOutputData();
mapper?.setInputData(filterData);
});
Small update: I fix all problems with filter, but now I have problem with planes:
I create a vtkPlane by points of object:
I don’t understand why you create as many plane as you have points then also I don’t know what does not work. You did not share the error or anything else. At that point we can only guess…
Also the way you create your points are as follow
o0 = x0, y0, z0
o1 = y0, z0, x1
o2 = z0, x1, y1
o3 = x1, y1, z1
Last question:
meshItem.getMapper().getInputData().getPolys().getNumberOfCells() provide me 252056 elements
if I request meshItem.getMapper().getInputData().getPolys().getCell(0) - I got [0, 1, 2] array
If I request meshItem.getMapper().getInputData().getPolys().getCell(2) - I got [2] array
Am I right understand number in the array - it is a number of point?
Is it possible to have 1 point in the poly?
What’s happen here:
meshItem.getMapper().getInputData().getPolys().getCell(252057) // return me a big array.