[vtkusers] Line Intersection with Plane: Seems to return almost all of the plane

Alex Malyushytskyy alexmalvtk at gmail.com
Tue Sep 10 15:27:57 EDT 2013


To get help you need at least to provide all 6 planes and line definition
and results you get.
Small compilable code would also help.

Guessing is not needed.
Depending on the orientation of the cube and line it may intersect  2, 4 or
6 planes.
Keep in mind you are talking about planes , not faces.

Alex




On Tue, Sep 10, 2013 at 5:00 AM, Doug Hoppes <dhoppes at mbfbioscience.com>wrote:

>  Hi all,****
>
> ** **
>
>                 I’m trying to use the vtkplane::IntersectWithLine() method
> and it seems to be giving me some issues (which, most likely is on my
> part).  I have a cube that I’m sending a line through.  I need to find the
> plane where the line enters and the one where the line exits.  The way that
> I do this is to create 6 vtkplanes using (coordinates defined appropriately
> for each plane):****
>
> ** **
>
>       pPoint1[0] = 0;               pPoint1[1] = 0;         pPoint1[2] =
> 0;****
>
>       pPoint2[0] = 0;               pPoint2[1] = dfYRange;  pPoint2[2] =
> 0;****
>
>       pPoint3[0] = dfXRange;  pPoint3[1] = 0;               pPoint3[2] =
> 0;****
>
> ** **
>
>       vtkSmartPointer<vtkPlane> pPlane1 = vtkSmartPointer<vtkPlane>::New
> ();****
>
>       pPlane1->SetOrigin(pPoint1);****
>
>       vtkTriangle::ComputeNormal(pPoint1, pPoint2, pPoint3, normals);****
>
>       pPlane1->SetNormal(normals);****
>
> ** **
>
> When I call, ****
>
> ** **
>
> int icheck = pIntersectionPlane->IntersectWithLine(pLineStart, pLineEnd,
> lineCoordinate, pIntersectionPoint);****
>
> ** **
>
> the value of icheck is > 0 for 4 of the 6 planes.  I don’t get it.  From
> the documentation, seems that it should be > 0 for any plane that it
> intersects.  So, I would always assume that it would intersect with only 2
> of the 6 planes.  ** **
>
> ** **
>
> Any idea what’s going on?****
>
> ** **
>
> Doug****
>
> ** **
>
> ** **
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130910/eca2685e/attachment.htm>


More information about the vtkusers mailing list