<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>Andrew, Cory,</p>
<p>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.</p>
<p>I've attached my trefoil knot code in a zip. The partial derivatives make a big difference to shadows.</p>
<p>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.</p>
<p>I'm pleased that this works, but the output surface is rather jagged when compared to what I get with MathMod. Any ideas?</p>
<p>For the VTK user list, the zipped files I mention are here:</p>
<p>https://github.com/logicmonkey/curves/tree/master/vtk/TrefoilKnot</p>
<p>( unzip/git pull; cd TrefoilKnot; mkdir build; cd build; cmake ..; make; ./bin/TrefoilKnot )</p>
<p>Thanks again for your help.</p>
<p>--</p>
<p>Piers Barber (-=:LogicMonkey;=-)</p>
<p>On 2015-10-01 00:19, Andrew Maclean wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr">If I understand you correctly, then the approach described in <a href="http://www.vtk.org/img/ParametricSurfaces.pdf">http://www.vtk.org/img/ParametricSurfaces.pdf</a>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.
<div> </div>
<div>I attach a VTK 6.3+ version of the example for you to try out.</div>
<div> </div>
<div>I'll add this to the VTK examples sometime next week.</div>
<div> </div>
<div>Once you get a surface you might like to look at:</div>
<div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ElevationBandsWithGlyphs">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/ElevationBandsWithGlyphs</a></div>
<div>and</div>
<div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CurvatureBandsWithGlyphs">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CurvatureBandsWithGlyphs</a></div>
<div>for some visualisation ideas.</div>
<div> </div>
<div> </div>
<div>Regards</div>
<div> Andrew</div>
<div><br />
<div class="gmail_extra"><br />
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: #cccccc; border-left-style: solid; padding-left: 1ex;"><br />---------- Forwarded message ----------<br />From: Cory Quammen <<a href="mailto:cory.quammen@kitware.com">cory.quammen@kitware.com</a>><br />To: <a href="mailto:piers.barber@logicmonkey.co.uk">piers.barber@logicmonkey.co.uk</a><br />Cc: "<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br />Date: Wed, 30 Sep 2015 09:15:45 -0400<br />Subject: Re: [vtkusers] Computational Geometry - user equations?<br />
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Tue, Sep 29, 2015 at 12:13 PM, <span><<a href="mailto:piers.barber@logicmonkey.co.uk">piers.barber@logicmonkey.co.uk</a>></span> wrote:<br />
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: #cccccc; border-left-style: solid; padding-left: 1ex;">Hi All,<br /><br /> 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.<br /><br /> 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:<br /><br /><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ParametricObjectsDemo#CMakeLists.txt">http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ParametricObjectsDemo#CMakeLists.txt</a></blockquote>
<div> </div>
<div>Yep, that looks like a good way to go.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: #cccccc; border-left-style: solid; padding-left: 1ex;">I'm using vtkParametricTorus[.h, .cxx] as a template, but is there an easier and more direct way to do this?</blockquote>
<div> </div>
<div>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.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>Cory</div>
<div> </div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: #cccccc; border-left-style: solid; padding-left: 1ex;">Thanks!<br /><br /> -=:LM:=-<br /> _______________________________________________<br /> Powered by <a href="http://www.kitware.com">www.kitware.com</a><br /><br /> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br /><br /> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br /><br /> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers">http://markmail.org/search/?q=vtkusers</a><br /><br /> Follow this link to subscribe/unsubscribe:<br /><a href="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</a></blockquote>
</div>
<br /><br clear="all" />
<div> </div>
-- <br />
<div>Cory Quammen<br />R&D Engineer<br />Kitware, Inc.</div>
</div>
</div>
<br /><br /></blockquote>
</div>
-- <br />
<div class="gmail_signature">___________________________________________<br />Andrew J. P. Maclean<br /><br />___________________________________________</div>
</div>
</div>
</div>
</blockquote>
<p> </p>
<div> </div>
</body></html>