[vtkusers] filling in a sphere's intersection with a plane
david.gobbi at gmail.com
Sat Jan 12 11:22:03 EST 2019
>From the images (especially slice89) it looks like your program still
renders the whole sphere, in addition to rendering the cross-section.
Remove or disable the code that renders the whole sphere.
I'm pretty sure that the problem is that you haven't yet written code that
updates the origin of your cut plane when the user changes the slice.
Even then, as I mentioned before, there are likely to be rendering problems
due to coincident geometry (e.g. the image might get rendered on top of the
polydata and thus obscure it). It's possible that the
SetResolveCoincidentTopologyToPolygonOffset method isn't available in the
language you are using. I know there are other ways of ensuring that the
polydata is drawn on top (e.g. move it slightly closer to the camera) but
right now I can't recall a simple way to do this in VTK (only complicated
On Fri, Jan 11, 2019 at 9:30 PM The Merper <msmerps at gmail.com> wrote:
> Thank you David,
> I tried to do as you suggested with the following code:
> // Use vtkCutter to derive the contour of the
> intersection with the Z-plane
> var Origin=_ZPlaneSource.GetOrigin();
> var Normal= _ZPlaneSource.GetNormal();
> var TempPlane = vtkPlane.New();
> TempPlane.SetOrigin(Origin, Origin, Origin);
> TempPlane.SetNormal(Normal, Normal, Normal);
> var Cutter = vtkCutter.New();
> var CutterMapper = vtkPolyDataMapper.New();
> // Use vtkContourTriangulator to fill the polyline
> contour with traingles
> vtkContourTriangulator Poly =
> var PolyMapper = vtkDataSetMapper.New();
> var PolyActor = vtkActor.New();
> / 255,
> ((double)_LandmarkColors[i].G) / 255,
> ((double)_LandmarkColors[i].B) / 255);
> And it renders a circle in the slice that intersects the center of the
> sphere (i.e., the attached slice91.png). However, when you go below or
> above that slice, you just see the outline of the sphere (e.g.,
> slice90.jpg). When you go down one or more slices further you see the
> bottom of the sphere with 3D shading (e.g., slice89.jpg), until it goes out
> of view.
> Did I do something wrong? My PolyMapper instance of vtkDataSetMaper does
> not have a method SetResolveCoincidentTopologyToPolygonOffset().
> thanks again,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers