[vtkusers] Curve / Equal Subdivision

Bill Lorensen bill.lorensen at gmail.com
Tue Jul 10 15:31:14 EDT 2012


Please provide a simple batch example, without the widget, that illustrates
the problem.

Bill

On Tue, Jul 10, 2012 at 3:13 PM, Jean-Hugues Royer <jhroyer at joher.com>wrote:

> Hi,
>
> In fact  I create a contour widget (contourwidget) to draw the curve (with
> a vtkBezierContourLineInterpolat**or) and to show the problem I trace a
> straight line (instead of a curve) with two single points (begining / end)
> parallel to the X axis and with Z = 0.
>
> Then I create a vtkSplineFilter (splinefilter) and do a
> splinefilter->Setinput(**countourwidget->**GetContourRepresentation()->**
> GetContourRepresentationAsPoly**Data()).
>
> Then I call splinefilter->**SetSubdivideToLength() and
> splinefilter->SetLength(D) with desired distance (D) between points and
> finally splinefilter->Update().
>
> Then I get every points by calling splinefilter->GetOutput()->**GetPoint(n)
> and compute the distance consecutive points: Sqrt( (x2-x1)^2 + (y2-y1)^2 +
> (z2-z1) ^ 2).
>
> When I do that with a straight line the distance is always different than
> the one I asked, when I do that with a curve (a simple arc) only the first
> and last ~20 points have a different distance.
>
> So far the workaround I found is to call SetLength(D/100) (so I get 100x
> more points than needed) and I manually select the points among them which
> have almost distance D between them, it works but it requires more
> computation and it is not totally accurate.
>
> I don't think it's related but I'm using Activiz, and the straight line I
> use has a total length of 95mm and I ask for distance (D) of 0.18648mm. (I
> tried different values of D and I get the same issue)
>
> Regards.
>
>
> On 10/07/2012 17:52, Jana Sefcikova wrote:
>
>> Hi,
>> can I ask you , how did you check whether they are or are not equally
>> distributed ?
>> Also what was length of the  curve and distance, in the case when you get
>> good distribution except corner points?
>>
>> Jana
>>
> ______________________________**_________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<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 <http://www.vtk.org/Wiki/VTK_FAQ>
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/**listinfo/vtkusers<http://www.vtk.org/mailman/listinfo/vtkusers>
>



-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120710/8e35fa21/attachment.htm>


More information about the vtkusers mailing list