[vtkusers] vtkCutter accuracy?

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Wed Sep 25 18:10:36 EDT 2002


Hi Jean-Philippe,
I have played a bit with implicit functions so this one interested me. I
just did a quick test in a spreadsheet, following the code in vtkCutter,
vtkPlane and vtkQuad. The algorithms appears fine.
The steps are: each point on the quad is evaluated with
vtkPlane->EvaluateFunction, which performs dot product of point with cell
normal. This gives a set of scalars, one per quad point. Those scalars are
interpolated along the quad edges. The edges P1-P2 and P4-P1 have t!=0 and
the cell is cut through those edges using linear interpolation. My
independent calculations result in t=0.5 (exactly) and two new points at
x=100, not 100.5.
So perhaps some small rounding error is being magnified? or maybe vtkQuad
is not used, vtkPolygon instead? Or some error in the implementation?. The
next step would be to trace through in a debugger and see the call sequence
and the actual values calculated. Have you got a debug copy of the vtk
library?!

  regards
    Dave Pont
(Embedded image moved to file: pic16282.pcx)


|--------+---------------------------------->
|        |          "Andreu, Jean-Philippe" |
|        |          <jean-philippe.andreu at jo|
|        |          anneum.at>              |
|        |          Sent by:                |
|        |          vtkusers-admin at public.ki|
|        |          tware.com               |
|        |                                  |
|        |                                  |
|        |          25/09/2002 19:43        |
|        |                                  |
|--------+---------------------------------->
  >------------------------------------------------------------------------------------------------------------|
  |                                                                                                            |
  |      To:     vtkusers at public.kitware.com                                                                   |
  |      cc:                                                                                                   |
  |      Subject:     [vtkusers] vtkCutter accuracy?                                                           |
  >------------------------------------------------------------------------------------------------------------|




Hi all,

I tested vtkCutter on a simple planar rectangular patch (see below) with a
plane (plane->SetOrigin(100.0, 0.0, 0.0); plane->SetNormal(1.0, 0.0, 0.0);)
as implict function.

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 4 float
50 200 70 150 200 70 150 200 90
50 200 90
POLYGONS 1 5
4 0 1 2 3

CELL_DATA 1
POINT_DATA 4
SCALARS scalars float
LOOKUP_TABLE default
1 1 1 1

As a result I get the following:

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET POLYDATA
POINTS 2 float
100.5 200 90 100.5 200 70
LINES 1 3
2 0 1

CELL_DATA 1
POINT_DATA 2
SCALARS scalars float
LOOKUP_TABLE default
1 1

I ask myself why I get 100.5 and not 100...

Any idea?

Thanx in advance for your help,

Jean-Philippe
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <
http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic16282.pcx
Type: application/octet-stream
Size: 22328 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20020926/5787bcd5/attachment.obj>


More information about the vtkusers mailing list