[vtkusers] Computational Geometry - user equations?

piers.barber at logicmonkey.co.uk piers.barber at logicmonkey.co.uk
Sat Oct 3 20:48:28 EDT 2015


 

Andrew, Cory, 

Thanks for the attachment - as a non-coder it
bridged the gap between the PDF that I've seen before and what actually
needed to be done. 

I've attached my trefoil knot code in a zip. The
partial derivatives make a big difference to shadows. 

I'm on Arch
Linux with VTK 6.1.0, and the only change I needed to make to get the
example to build was to the CMakeLists.txt - so it picks up OpenGL
rather than OpenGL2. 

I'm pleased that this works, but the output
surface is rather jagged when compared to what I get with MathMod. Any
ideas? 

For the VTK user list, the zipped files I mention are here:


https://github.com/logicmonkey/curves/tree/master/vtk/TrefoilKnot 

(
unzip/git pull; cd TrefoilKnot; mkdir build; cd build; cmake ..; make;
./bin/TrefoilKnot ) 

Thanks again for your help. 

-- 

Piers Barber
(-=:LogicMonkey;=-) 

On 2015-10-01 00:19, Andrew Maclean wrote: 

> If
I understand you correctly, then the approach described in
http://www.vtk.org/img/ParametricSurfaces.pdf [10]in " How to create
your own surface" should work for you. If you adopt this approach, you
just build using the library and you do not need to modify the VTK
library. 
> 
> I attach a VTK 6.3+ version of the example for you to try
out. 
> 
> I'll add this to the VTK examples sometime next week. 
> 
>
Once you get a surface you might like to look at: 
>
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ElevationBandsWithGlyphs
[11] 
> and 
>
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CurvatureBandsWithGlyphs
[12] 
> for some visualisation ideas. 
> 
> Regards 
> Andrew 
> 
>>
---------- Forwarded message ----------
>> From: Cory Quammen
<cory.quammen at kitware.com [5]>
>> To: piers.barber at logicmonkey.co.uk
[6]
>> Cc: "vtkusers at vtk.org [7]" <vtkusers at vtk.org [8]>
>> Date: Wed,
30 Sep 2015 09:15:45 -0400
>> Subject: Re: [vtkusers] Computational
Geometry - user equations?
>> 
>> On Tue, Sep 29, 2015 at 12:13 PM,
<piers.barber at logicmonkey.co.uk [9]> wrote:
>> 
>>> Hi All,
>>> 
>>> I'd
like to specify a surface f(u,v) in 3D with my own parametric equation
system {x(u,v), y(u,v), z(u,v)}. And then visualize it.
>>> 
>>> The
only way I can see to do this is to add my function to the library
source code, build the library and then call my function as described
here:
>>> 
>>>
http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ParametricObjectsDemo#CMakeLists.txt
[1]
>> 
>> Yep, that looks like a good way to go. 
>> 
>>> I'm using
vtkParametricTorus[.h, .cxx] as a template, but is there an easier and
more direct way to do this?
>> 
>> You can define your subclass of
vtkParametricFunction in your local project - no need to add it to VTK,
which is what I think you were saying above. 
>> 
>> Were you looking
for a vtkParametricFunction subclass that takes an expression for
x(u,v), etc.? That doesn't exist as far as I know, but that would be
cool to have. 
>> 
>> Cory 
>> Thanks!
>> 
>> -=:LM:=-
>>
_______________________________________________
>> Powered by
> -- 
> 
>
___________________________________________
> Andrew J. P. Maclean
> 
>
___________________________________________

 

Links:
------
[1]
http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ParametricObjectsDemo#CMakeLists.txt
[2]
http://www.vtk.org/Wiki/VTK_FAQ
[3]
http://markmail.org/search/?q=vtkusers
[4]
http://public.kitware.com/mailman/listinfo/vtkusers
[5]
mailto:cory.quammen at kitware.com
[6]
mailto:piers.barber at logicmonkey.co.uk
[7] mailto:vtkusers at vtk.org
[8]
mailto:vtkusers at vtk.org
[9] mailto:piers.barber at logicmonkey.co.uk
[10]
http://www.vtk.org/img/ParametricSurfaces.pdf
[11]
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ElevationBandsWithGlyphs
[12]
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CurvatureBandsWithGlyphs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151004/03fda4d8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TrefoilKnot.zip
Type: application/octet-stream
Size: 4577 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151004/03fda4d8/attachment.obj>


More information about the vtkusers mailing list