[vtk-developers] Class design for spline visualizations

Lin M majcjc at gmail.com
Tue Jun 30 13:35:38 EDT 2015


I didn't separate the homogenous coordinate with point coordinates but
stored them all in a vtkDataArray with 4 components per tuple just as you
suggest. In this way, vtkStructuredGrid cannot hold them as vtkPoints. The
current API is like

void vtkNURBSPatchAdaptor::GetPatchShape(vtkUnstructuredGrid* outputSp,
vtkDataArray* ctrlPts, int* ctrlPtsNum)
the outputSp holds the surface mesh, ctrlPts and ctrlPtsNum hold
information and data of nurbs control points,
and the vtkSturcturedGrid only holds knot vectors and length.

On Tue, Jun 30, 2015 at 12:59 PM, David Thompson <david.thompson at kitware.com
> wrote:

> > I forgot one thing, the vtkPoints can not hold a 4-dimension
> vtkDataArray so I cannot store the control points in the vtkStructuredGrid.
> Currently I stored it separately in a vtkDataArray for test. Do I need to
> implement a vtkPoints subclass likt vtkControlPoints to allow it store
> 4-dimension coordinates?
>
> Hi Lin,
>
> I would not create a new class. There are two alternatives and different
> spline software packages use them both:
>
> + Do as you have done, keeping point coordinates separate from the
> homogenous coordinate. This approach increases the number of things that
> have to get passed around between functions.
>
> + Pass the points around as just a vtkDataArray with 4 components per
> tuple. This approach makes it hard to use just the first three coordinates
> as points when you know the homogeneous coordinate is 1 for all of the
> values you are dealing with.
>
> My mild preference is the latter (i.e., make the arguments to your
> functions take a vtkDataArray with 4 components per tuple), but either will
> be fine.
>
> I want to avoid writing a 4-D point subclass because then algorithms that
> generate patches as output will need a new dataset type and it will be hard
> to use existing filters (such as the vtkArrayCalculator) on them.
>
>         David
>
> >
> > On Tue, Jun 30, 2015 at 12:42 PM, David Thompson <
> david.thompson at kitware.com> wrote:
> > Hi Lin,
> >
> > > I have finished the conversion from NURBS patch to Bezier patch and
> generation of surface meshes.
> > >
> > > Now we can load some real nurbs shapes to test. :-)
> >
> > Great! I'm working on 2 sources of data.
> >
> > + [CGM](https://bitbucket.org/fathomteam/cgm) provides a nice interface
> to OpenCascade's surface definitions, including these methods:
> >
> >
> https://bitbucket.org/fathomteam/cgm/src/1aab72dc7c4ca6d0333a88df7b857e49d661db43/geom/Surface.hpp?at=master#cl-370
> >
> https://bitbucket.org/fathomteam/cgm/src/1aab72dc7c4ca6d0333a88df7b857e49d661db43/geom/Curve.hpp?at=master#cl-364
> >
> > CGM has a few CAD models for testing in the "test" directory of the
> source repo.
> >
> > + [PetIGA](https://bitbucket.org/dalcinl/petiga) has 3D NURBS including
> simulation results but is in a binary file format that is undocumented
> (except in the source).
> >
> >         David
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150630/fbe61fb6/attachment.html>


More information about the vtk-developers mailing list