[vtk-developers] Class design for spline visualizations

Lin M majcjc at gmail.com
Tue Jun 9 17:05:13 EDT 2015


Hi Dr. Thomposon,

I have made it support 3D ellipse with function

void vtkPatchInterpolation::GenerateEllipseCtrlPt(
  vtkDataArray* P_i,
  vtkVector3d center, vtkVector3d majorAxis, vtkVector3d minorAxis,
  int quadrant)

As you can see in the python test, I call this function 4 times for each
quadrant to generate the entire ellipse. Since we need to support multiple
patches, I think it's better to define a new dataset class for bezier
patches as you mentioned before about  creating a new vtkControlPoints
class that inherits from vtkPoints and allows for an extra coordinate.

Another question is that currently the domain of parameter coordinate is
[0, 1] for each patch. Do you think it's better to make the domain
continuously, namely [0, 0.25] for the first quadrant, [0.25, 0.75] for the
second quadrant, etc?

Best,
Lin

On Thu, Jun 4, 2015 at 10:38 AM, David Thompson <david.thompson at kitware.com>
wrote:

> Hi Lin,
>
> > I have written a helper function to generate control points for
> arbitrary ellipse and modified the PatchInterpolation.py test to image test
> which contains line, circle and ellipse.
>
> Excellent! I will do a detailed review of the changes this evening. At a
> quick glance, some things that would be nice are:
>
> 1. Being able to specify ellipses in 3D with vectors (see
> Common/DataModel/vtkVector.h) representing the center, major axis, and
> minor axis (both direction and length). The minor axis would have to be
> orthogonalized using Gram-Shmidt orthonormalization (
> https://en.wikipedia.org/wiki/Gram%E2%80%93Schmidt_process ).
>
> 2. Being able to return multiple patches so that an entire ellipse could
> be generated at once. Then, besides the 3 vectors (center, major, minor),
> two angles could be accepted indicating where the patch could start and
> stop. This would mean outputting multiple patch points. It will also
> require a subdivision algorithm to split a patch at a given parameter value
> (which we will use in several other places later this summer).
>
> In terms of further development, in order to render 2-D splines properly,
> we will need a method to evaluate surface normals for patches. More
> generally, it would be nice to have an additional evaluation method that
> computes the derivative as well as the coordinates of the Bézier patch at
> the input points. (Note that the derivative is a vector with the same
> dimension as the parameter-space of the patch.)
>
> > A question about the push the data. I followed the instruction in
> https://gitlab.kitware.com/vtk/vtk/blob/master/Documentation/dev/git/data.md,
> but I didn't see the message when doing the commit step.
>
> That's OK, we'll figure it out when it comes time to submit the patch for
> review and inclusion into VTK. Hopefully we can do that next week.
>
>         Thanks,
>         David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150609/a59a5c6a/attachment.html>


More information about the vtk-developers mailing list