[vtkusers] Computational Geometry - user equations?

Andrew Maclean andrew.amaclean at gmail.com
Wed Sep 30 22:26:08 EDT 2015


That will work nicely in the code I sent you. You just have to modify
Evaluate(double uvw[3], double Pt[3], double Duvw[9]) your equations for
Fx, Fy, Fz would correspond to Pt[0] ... Pt[2] respectively.

Calculating the derivatives could be fun!
You could look at:
http://www.derivative-calculator.net/

In Evaluate() note that precomputing terms simplifies things a lot.


Regards
   Andrew


On Thu, Oct 1, 2015 at 10:26 AM, <piers.barber at logicmonkey.co.uk> wrote:

> Thanks both - I will have a good look at what you've said. I'm not a
> software engineer but I'll work it through.
>
> Meantime, here's an example that I created in MathMod - the syntax is self
> explanatory. The derivation from simple space curve equations is in the
> same git repo and done in Maxima.
>
>
> https://github.com/logicmonkey/curves/blob/master/mathmod/lm_trefoil_knot.js
>
> Cheers,
>
> --
>
> -=:LM:=-
>
> 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.pdfin " 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
> and
>
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/CurvatureBandsWithGlyphs
> for some visualisation ideas.
>
>
> Regards
>    Andrew
>
>
>
>> ---------- Forwarded message ----------
>> From: Cory Quammen <cory.quammen at kitware.com>
>> To: piers.barber at logicmonkey.co.uk
>> Cc: "vtkusers at vtk.org" <vtkusers at vtk.org>
>> 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> 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
>>
>>
>> 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 www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> 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
>>>
>>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>>
>>
>> --
>> Cory Quammen
>> R&D Engineer
>> Kitware, Inc.
>>
>>
>> --
> ___________________________________________
> Andrew J. P. Maclean
>
> ___________________________________________
>
>
>
>



-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151001/1804526f/attachment.html>


More information about the vtkusers mailing list