|
From: Peter K. <pke...@gm...> - 2014-11-01 19:49:15
|
Hi Jerzy and Ben,
Thanks for you answers!
I must say that although Ben is right in principle, Jerzy's answer is
exactly what I was looking for. Even if matplotlib can't do it by
itself, there appears to be other libraries that do the heavy lifting
and return a set of triangles which can then be placed in a
Polygon3DCollection and plotted.
It's always good to know what something is called. Searching for '3D
contours' was leading nowhere, but plugging in '*polygonization of the
implicit surface' *returned a multitude of descriptions of the problem
and libraries. It turns out I had been trying to implement the marching
cubes algorithm myself for the better part of the last week. Oops!
Thanks again to the both of you!!
-Peter
On 11/1/14, 8:34 PM, Benjamin Root wrote:
> Jerzy,
>
> Actually, my response is still completely valid. You can only plot
> surfaces that can be represented parametrically in two dimensions.
> Find me a single plotting library that can do differently without
> having to get to this final step. For matplotlib, it is up to the user
> to get the data to that point. As you stated, he is seeking
> polygonization of an *implicit* surface. Matplotlib has no means of
> understanding this. And this is unlikely to happen anytime soon given
> the inherent 2D limitations of Matplotlib.
>
> I am sorry if the answer is unsatisfactory to you, but it is the
> correct one to give.
>
> Ben Root
>
>
> On Sat, Nov 1, 2014 at 2:49 PM, Jerzy Karczmarczuk
> <jer...@un... <mailto:jer...@un...>>
> wrote:
>
>
> Le 01/11/2014 19:21, Benjamin Root answers the query of Peter
> Kerpedjiev, who wants to plot (with Matplotlib) the surface of an
> implicit surface (at least it was his presented example).
>
>> Your comment "of course, plotting a sphere can be done in
>> spherical coordinates" is actually the right thought process.
>> Spherical coordinates is how you parametrize your spherical
>> surface. Pick a coordinate system that is relevant to your
>> problem at hand and use it.
>
> Sorry Ben, but this is not an answer. P.K. clearly states that his
> case is more complicated, and no parametrization is likely.
> Anyway, the spherical exercise as it is presented uses the 3D
> constraint, it is not parametric.
>
> The general solution is the *polygonization of the implicit
> surface*, which is a well established technology (although
> non-trivial). For example the /marching cubes / marching
> simplices/ algorithms and their variants.
> These are techniques for the polygonization of a mesh.
>
> If P.K. has an analytic formula for his distributions, and is able
> to compute gradients, etc., there are some more efficient
> techniques, but in general it is the case for solving the equation
> F(x,y,z)=0 for {x,y,z} ; here Matplotlib doesn't offer (yet) any
> tools if I am not mistaken.
>
> Jerzy Karczmarczuk
> Caen, France.
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|