Mayavi Display outer surface only

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Mayavi Display outer surface only

Yohann Morille
Hi,

I am trying to display only the outer surface of 2 overlapping glyphs.

Starting from this example:

################################
from mayavi import mlab
import numpy as np

mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
mlab.clf()

pts1 = np.array([0, 0, 1])
pts2 = np.array([1, 1, 0])


outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2], scale_factor=2.5  ,resolution=20,color=(1, 0, 0),opacity=0.3)
outer1.actor.property.representation = 'wireframe'
outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2], scale_factor=2.5  ,resolution=20,color=(0, 1, 0),opacity=0.3)
outer2.actor.property.representation = 'wireframe'

mlab.show()
###############################

I want the same but with no wireframe where glyphs (outer1 and outer2) are overlapping.
Is it possible ?
Thanks !

Youm



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Pietro Berkes
Hi Youm,

if I understand correctly, you would like to compute the internal part of the union of the two spheres (or any other object you may have), and remove the wireframe points that belong to the intersection, is that correct? As far as I know, there is nothing in mayavi that would allow you to do this out-of-the-box.

All the best,
Pietro


On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille <[hidden email]> wrote:
Hi,

I am trying to display only the outer surface of 2 overlapping glyphs.

Starting from this example:

################################
from mayavi import mlab
import numpy as np

mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
mlab.clf()

pts1 = np.array([0, 0, 1])
pts2 = np.array([1, 1, 0])


outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2], scale_factor=2.5  ,resolution=20,color=(1, 0, 0),opacity=0.3)
outer1.actor.property.representation = 'wireframe'
outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2], scale_factor=2.5  ,resolution=20,color=(0, 1, 0),opacity=0.3)
outer2.actor.property.representation = 'wireframe'

mlab.show()
###############################

I want the same but with no wireframe where glyphs (outer1 and outer2) are overlapping.
Is it possible ?
Thanks !

Youm



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev




--
Pietro Berkes
Scientific software developer
Enthought UK



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Yohann Morille
Hi Pietro,

this
is exactly what I wanted.

Thanks for your answer.

Youm

2012/10/22 Pietro Berkes <[hidden email]>
Hi Youm,

if I understand correctly, you would like to compute the internal part of the union of the two spheres (or any other object you may have), and remove the wireframe points that belong to the intersection, is that correct? As far as I know, there is nothing in mayavi that would allow you to do this out-of-the-box.

All the best,
Pietro


On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille <[hidden email]> wrote:
Hi,

I am trying to display only the outer surface of 2 overlapping glyphs.

Starting from this example:

################################
from mayavi import mlab
import numpy as np

mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
mlab.clf()

pts1 = np.array([0, 0, 1])
pts2 = np.array([1, 1, 0])


outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2], scale_factor=2.5  ,resolution=20,color=(1, 0, 0),opacity=0.3)
outer1.actor.property.representation = 'wireframe'
outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2], scale_factor=2.5  ,resolution=20,color=(0, 1, 0),opacity=0.3)
outer2.actor.property.representation = 'wireframe'

mlab.show()
###############################

I want the same but with no wireframe where glyphs (outer1 and outer2) are overlapping.
Is it possible ?
Thanks !

Youm



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev




--
Pietro Berkes
Scientific software developer
Enthought UK



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Fred
Le 22/10/2012 14:48, Yohann Morille a écrit :
> Hi Pietro,
>
> this is exactly what I wanted.
> Thanks for your answer.

Mmmh, I would try with the DataSetClipper filter...

> Youm
>
> 2012/10/22 Pietro Berkes <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Youm,
>
>     if I understand correctly, you would like to compute the internal
>     part of the union of the two spheres (or any other object you may
>     have), and remove the wireframe points that belong to the
>     intersection, is that correct? As far as I know, there is nothing in
>     mayavi that would allow you to do this out-of-the-box.
>
>     All the best,
>     Pietro
>
>
>     On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille
>     <[hidden email] <mailto:[hidden email]>> wrote:
>
>         Hi,
>
>         I am trying to display only the outer surface of 2 overlapping
>         glyphs.
>
>         Starting from this example:
>
>         ################################
>         from mayavi import mlab
>         import numpy as np
>
>         mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
>         mlab.clf()
>
>         pts1 = np.array([0, 0, 1])
>         pts2 = np.array([1, 1, 0])
>
>
>         outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2],
>         scale_factor=2.5  ,resolution=20,color=(1, 0, 0),opacity=0.3)
>         outer1.actor.property.representation = 'wireframe'
>         outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2],
>         scale_factor=2.5  ,resolution=20,color=(0, 1, 0),opacity=0.3)
>         outer2.actor.property.representation = 'wireframe'
>
>         mlab.show()
>         ###############################
>
>         I want the same but with no wireframe where glyphs (outer1 and
>         outer2) are overlapping.
>         Is it possible ?
>         Thanks !
>
>         Youm
>
>
>
>         _______________________________________________
>         Enthought-Dev mailing list
>         [hidden email]
>         <mailto:[hidden email]>
>         https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
>     --
>     Pietro Berkes
>     Scientific software developer
>     Enthought UK
>
>
>
>     _______________________________________________
>     Enthought-Dev mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev


--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Yohann Morille
OK Fred,
I will try following this way.
But first, I think that I have to extract "points" and "lines" that form each one of my two spheres (those represented when I use the wireframe representation) and I can not do.
Can I do that with:
edges = mlab.pipeline.extract_edges(outer1)
?

Youm



2012/10/22 Fred <[hidden email]>
Le 22/10/2012 14:48, Yohann Morille a écrit :
> Hi Pietro,
>
> this is exactly what I wanted.
> Thanks for your answer.

Mmmh, I would try with the DataSetClipper filter...

> Youm
>
> 2012/10/22 Pietro Berkes <[hidden email]
> <mailto:[hidden email]>>
>
>     Hi Youm,
>
>     if I understand correctly, you would like to compute the internal
>     part of the union of the two spheres (or any other object you may
>     have), and remove the wireframe points that belong to the
>     intersection, is that correct? As far as I know, there is nothing in
>     mayavi that would allow you to do this out-of-the-box.
>
>     All the best,
>     Pietro
>
>
>     On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille
>     <[hidden email] <mailto:[hidden email]>> wrote:
>
>         Hi,
>
>         I am trying to display only the outer surface of 2 overlapping
>         glyphs.
>
>         Starting from this example:
>
>         ################################
>         from mayavi import mlab
>         import numpy as np
>
>         mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
>         mlab.clf()
>
>         pts1 = np.array([0, 0, 1])
>         pts2 = np.array([1, 1, 0])
>
>
>         outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2],
>         scale_factor=2.5  ,resolution=20,color=(1, 0, 0),opacity=0.3)
>         outer1.actor.property.representation = 'wireframe'
>         outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2],
>         scale_factor=2.5  ,resolution=20,color=(0, 1, 0),opacity=0.3)
>         outer2.actor.property.representation = 'wireframe'
>
>         mlab.show()
>         ###############################
>
>         I want the same but with no wireframe where glyphs (outer1 and
>         outer2) are overlapping.
>         Is it possible ?
>         Thanks !
>
>         Youm
>
>
>
>         _______________________________________________
>         Enthought-Dev mailing list
>         [hidden email]
>         <mailto:[hidden email]>
>         https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
>     --
>     Pietro Berkes
>     Scientific software developer
>     Enthought UK
>
>
>
>     _______________________________________________
>     Enthought-Dev mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev


--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Fred
Le 23/10/2012 15:52, Yohann Morille a écrit :
> OK Fred,
> I will try following this way.
> But first, I think that I have to extract "points" and "lines" that form
> each one of my two spheres (those represented when I use the wireframe
> representation) and I can not do.
> Can I do that with:
> edges = mlab.pipeline.extract_edges(outer1)
> ?
Hi,

I don't know mlab idioms but as I know mayavi, I have some idea about
how to do this in mayavi.

I'll answer asap if nobody answers before me ;-)

>
> Youm
>
>
>
> 2012/10/22 Fred <[hidden email] <mailto:[hidden email]>>
>
>     Le 22/10/2012 14:48, Yohann Morille a écrit :
>      > Hi Pietro,
>      >
>      > this is exactly what I wanted.
>      > Thanks for your answer.
>
>     Mmmh, I would try with the DataSetClipper filter...
>
>      > Youm
>      >
>      > 2012/10/22 Pietro Berkes <[hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>>
>      >
>      >     Hi Youm,
>      >
>      >     if I understand correctly, you would like to compute the internal
>      >     part of the union of the two spheres (or any other object you may
>      >     have), and remove the wireframe points that belong to the
>      >     intersection, is that correct? As far as I know, there is
>     nothing in
>      >     mayavi that would allow you to do this out-of-the-box.
>      >
>      >     All the best,
>      >     Pietro
>      >
>      >
>      >     On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille
>      > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>
>     wrote:
>      >
>      >         Hi,
>      >
>      >         I am trying to display only the outer surface of 2
>     overlapping
>      >         glyphs.
>      >
>      >         Starting from this example:
>      >
>      >         ################################
>      >         from mayavi import mlab
>      >         import numpy as np
>      >
>      >         mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
>      >         mlab.clf()
>      >
>      >         pts1 = np.array([0, 0, 1])
>      >         pts2 = np.array([1, 1, 0])
>      >
>      >
>      >         outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2],
>      >         scale_factor=2.5  ,resolution=20,color=(1, 0, 0),opacity=0.3)
>      >         outer1.actor.property.representation = 'wireframe'
>      >         outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2],
>      >         scale_factor=2.5  ,resolution=20,color=(0, 1, 0),opacity=0.3)
>      >         outer2.actor.property.representation = 'wireframe'
>      >
>      >         mlab.show()
>      >         ###############################
>      >
>      >         I want the same but with no wireframe where glyphs
>     (outer1 and
>      >         outer2) are overlapping.
>      >         Is it possible ?
>      >         Thanks !
>      >
>      >         Youm
>      >
>      >
>      >
>      >         _______________________________________________
>      >         Enthought-Dev mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > https://mail.enthought.com/mailman/listinfo/enthought-dev
>      >
>      >
>      >
>      >
>      >     --
>      >     Pietro Berkes
>      >     Scientific software developer
>      >     Enthought UK
>      >
>      >
>      >
>      >     _______________________________________________
>      >     Enthought-Dev mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > https://mail.enthought.com/mailman/listinfo/enthought-dev
>      >
>      >
>      >
>      >
>      > _______________________________________________
>      > Enthought-Dev mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>     --
>     Fred
>     _______________________________________________
>     Enthought-Dev mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev


--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Fred
In reply to this post by Yohann Morille
Le 23/10/2012 15:52, Yohann Morille a écrit :

> OK Fred,
> I will try following this way.
> But first, I think that I have to extract "points" and "lines" that form
> each one of my two spheres (those represented when I use the wireframe
> representation) and I can not do.
> Can I do that with:
> edges = mlab.pipeline.extract_edges(outer1)
> ?
>
> Youm

Youm,

Does it answer to your needs ?

>
>
>
> 2012/10/22 Fred <[hidden email] <mailto:[hidden email]>>
>
>     Le 22/10/2012 14:48, Yohann Morille a écrit :
>      > Hi Pietro,
>      >
>      > this is exactly what I wanted.
>      > Thanks for your answer.
>
>     Mmmh, I would try with the DataSetClipper filter...
>
>      > Youm
>      >
>      > 2012/10/22 Pietro Berkes <[hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>>
>      >
>      >     Hi Youm,
>      >
>      >     if I understand correctly, you would like to compute the internal
>      >     part of the union of the two spheres (or any other object you may
>      >     have), and remove the wireframe points that belong to the
>      >     intersection, is that correct? As far as I know, there is
>     nothing in
>      >     mayavi that would allow you to do this out-of-the-box.
>      >
>      >     All the best,
>      >     Pietro
>      >
>      >
>      >     On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille
>      > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>
>     wrote:
>      >
>      >         Hi,
>      >
>      >         I am trying to display only the outer surface of 2
>     overlapping
>      >         glyphs.
>      >
>      >         Starting from this example:
>      >
>      >         ################################
>      >         from mayavi import mlab
>      >         import numpy as np
>      >
>      >         mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
>      >         mlab.clf()
>      >
>      >         pts1 = np.array([0, 0, 1])
>      >         pts2 = np.array([1, 1, 0])
>      >
>      >
>      >         outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2],
>      >         scale_factor=2.5  ,resolution=20,color=(1, 0, 0),opacity=0.3)
>      >         outer1.actor.property.representation = 'wireframe'
>      >         outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2],
>      >         scale_factor=2.5  ,resolution=20,color=(0, 1, 0),opacity=0.3)
>      >         outer2.actor.property.representation = 'wireframe'
>      >
>      >         mlab.show()
>      >         ###############################
>      >
>      >         I want the same but with no wireframe where glyphs
>     (outer1 and
>      >         outer2) are overlapping.
>      >         Is it possible ?
>      >         Thanks !
>      >
>      >         Youm
>      >
>      >
>      >
>      >         _______________________________________________
>      >         Enthought-Dev mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > https://mail.enthought.com/mailman/listinfo/enthought-dev
>      >
>      >
>      >
>      >
>      >     --
>      >     Pietro Berkes
>      >     Scientific software developer
>      >     Enthought UK
>      >
>      >
>      >
>      >     _______________________________________________
>      >     Enthought-Dev mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > https://mail.enthought.com/mailman/listinfo/enthought-dev
>      >
>      >
>      >
>      >
>      > _______________________________________________
>      > Enthought-Dev mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>     --
>     Fred
>     _______________________________________________
>     Enthought-Dev mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev

--
Fred

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

snapshot.png (356K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Yohann Morille
Hi Fred,

it is exactly what I want !
I'm very curious to know how you have done !
Thanks a lot,

Y.

2012/10/26 Fred <[hidden email]>
Le 23/10/2012 15:52, Yohann Morille a écrit :
OK Fred,
I will try following this way.
But first, I think that I have to extract "points" and "lines" that form
each one of my two spheres (those represented when I use the wireframe
representation) and I can not do.
Can I do that with:
edges = mlab.pipeline.extract_edges(outer1)
?

Youm


Youm,

Does it answer to your needs ?




2012/10/22 Fred <[hidden email] <mailto:[hidden email]>>

    Le 22/10/2012 14:48, Yohann Morille a écrit :
     > Hi Pietro,
     >
     > this is exactly what I wanted.
     > Thanks for your answer.

    Mmmh, I would try with the DataSetClipper filter...

     > Youm
     >
     > 2012/10/22 Pietro Berkes <[hidden email]
    <mailto:[hidden email]>
     > <mailto:[hidden email] <mailto:[hidden email]>>>
     >
     >     Hi Youm,
     >
     >     if I understand correctly, you would like to compute the internal
     >     part of the union of the two spheres (or any other object you may
     >     have), and remove the wireframe points that belong to the
     >     intersection, is that correct? As far as I know, there is
    nothing in
     >     mayavi that would allow you to do this out-of-the-box.
     >
     >     All the best,
     >     Pietro
     >
     >
     >     On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille
     > <[hidden email] <mailto:[hidden email]>
    <mailto:[hidden email] <mailto:[hidden email]>>>
    wrote:
     >
     >         Hi,
     >
     >         I am trying to display only the outer surface of 2
    overlapping
     >         glyphs.
     >
     >         Starting from this example:
     >
     >         ################################
     >         from mayavi import mlab
     >         import numpy as np
     >
     >         mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
     >         mlab.clf()
     >
     >         pts1 = np.array([0, 0, 1])
     >         pts2 = np.array([1, 1, 0])
     >
     >
     >         outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2],
     >         scale_factor=2.5  ,resolution=20,color=(1, 0, 0),opacity=0.3)
     >         outer1.actor.property.representation = 'wireframe'
     >         outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2],
     >         scale_factor=2.5  ,resolution=20,color=(0, 1, 0),opacity=0.3)
     >         outer2.actor.property.representation = 'wireframe'
     >
     >         mlab.show()
     >         ###############################
     >
     >         I want the same but with no wireframe where glyphs
    (outer1 and
     >         outer2) are overlapping.
     >         Is it possible ?
     >         Thanks !
     >
     >         Youm
     >
     >
     >
     >         _______________________________________________
     >         Enthought-Dev mailing list
     > [hidden email]
    <mailto:[hidden email]>
     > <mailto:[hidden email]
    <mailto:[hidden email]>>
     > https://mail.enthought.com/mailman/listinfo/enthought-dev
     >
     >
     >
     >
     >     --
     >     Pietro Berkes
     >     Scientific software developer
     >     Enthought UK
     >
     >
     >
     >     _______________________________________________
     >     Enthought-Dev mailing list
     > [hidden email]
    <mailto:[hidden email]>
     > <mailto:[hidden email]
    <mailto:[hidden email]>>
     > https://mail.enthought.com/mailman/listinfo/enthought-dev
     >
     >
     >
     >
     > _______________________________________________
     > Enthought-Dev mailing list
     > [hidden email]
    <mailto:[hidden email]>
     > https://mail.enthought.com/mailman/listinfo/enthought-dev


    --
    Fred
    _______________________________________________
    Enthought-Dev mailing list
    [hidden email]
    <mailto:[hidden email]>
    https://mail.enthought.com/mailman/listinfo/enthought-dev




_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


--
Fred

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Fred
Le 26/10/2012 15:24, Yohann Morille a écrit :
> Hi Fred,
>
> it is exactly what I want !
> I'm very curious to know how you have done !
> Thanks a lot,
As I previously said, I do know Mayavi, but I don't know mlab syntax
(I don't use it for my purpose; I only use mayavi as a library, to write
my own UI using Traits).

So I can send you only the mayavi script that generates the figure.

Is it ok?


PS : ktools.free.fr ;-)
(quite obsolete, though).

>
> Y.
>
> 2012/10/26 Fred <[hidden email] <mailto:[hidden email]>>
>
>     Le 23/10/2012 15:52, Yohann Morille a écrit :
>
>         OK Fred,
>         I will try following this way.
>         But first, I think that I have to extract "points" and "lines"
>         that form
>         each one of my two spheres (those represented when I use the
>         wireframe
>         representation) and I can not do.
>         Can I do that with:
>         edges = mlab.pipeline.extract_edges(__outer1)
>         ?
>
>         Youm
>
>
>
>     Youm,
>
>     Does it answer to your needs ?
>
>
>
>
>         2012/10/22 Fred <[hidden email]
>         <mailto:[hidden email]> <mailto:[hidden email]
>         <mailto:[hidden email]>>>
>
>              Le 22/10/2012 14:48, Yohann Morille a écrit :
>          > Hi Pietro,
>          >
>          > this is exactly what I wanted.
>          > Thanks for your answer.
>
>              Mmmh, I would try with the DataSetClipper filter...
>
>          > Youm
>          >
>          > 2012/10/22 Pietro Berkes <[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>          > <mailto:[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>__>>
>          >
>          >     Hi Youm,
>          >
>          >     if I understand correctly, you would like to compute the
>         internal
>          >     part of the union of the two spheres (or any other object
>         you may
>          >     have), and remove the wireframe points that belong to the
>          >     intersection, is that correct? As far as I know, there is
>              nothing in
>          >     mayavi that would allow you to do this out-of-the-box.
>          >
>          >     All the best,
>          >     Pietro
>          >
>          >
>          >     On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille
>          > <[hidden email] <mailto:[hidden email]>
>         <mailto:yohann.morille@gmail.__com
>         <mailto:[hidden email]>>
>         <mailto:yohann.morille@gmail.__com
>         <mailto:[hidden email]>
>         <mailto:yohann.morille@gmail.__com
>         <mailto:[hidden email]>>>>
>              wrote:
>          >
>          >         Hi,
>          >
>          >         I am trying to display only the outer surface of 2
>              overlapping
>          >         glyphs.
>          >
>          >         Starting from this example:
>          >
>          >         ##############################__##
>          >         from mayavi import mlab
>          >         import numpy as np
>          >
>          >         mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
>          >         mlab.clf()
>          >
>          >         pts1 = np.array([0, 0, 1])
>          >         pts2 = np.array([1, 1, 0])
>          >
>          >
>          >         outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2],
>          >         scale_factor=2.5  ,resolution=20,color=(1, 0,
>         0),opacity=0.3)
>          >         outer1.actor.property.__representation = 'wireframe'
>          >         outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2],
>          >         scale_factor=2.5  ,resolution=20,color=(0, 1,
>         0),opacity=0.3)
>          >         outer2.actor.property.__representation = 'wireframe'
>          >
>          >         mlab.show()
>          >         ##############################__#
>          >
>          >         I want the same but with no wireframe where glyphs
>              (outer1 and
>          >         outer2) are overlapping.
>          >         Is it possible ?
>          >         Thanks !
>          >
>          >         Youm
>          >
>          >
>          >
>          >         _________________________________________________
>          >         Enthought-Dev mailing list
>          > [hidden email].__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>          > <mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>>
>          > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>          >
>          >
>          >
>          >
>          >     --
>          >     Pietro Berkes
>          >     Scientific software developer
>          >     Enthought UK
>          >
>          >
>          >
>          >     _________________________________________________
>          >     Enthought-Dev mailing list
>          > [hidden email].__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>          > <mailto:[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>>
>          > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>          >
>          >
>          >
>          >
>          > _________________________________________________
>          > Enthought-Dev mailing list
>          > [hidden email].__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>          > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>
>
>              --
>              Fred
>              _________________________________________________
>              Enthought-Dev mailing list
>         [hidden email].__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>
>         https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>
>
>
>
>         _________________________________________________
>         Enthought-Dev mailing list
>         [hidden email].__com
>         <mailto:[hidden email]>
>         https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>
>
>
>     --
>     Fred
>
>     _______________________________________________
>     Enthought-Dev mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev


--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Yohann Morille
Of course I am !
Thanks
Y

2012/10/26 Fred <[hidden email]>
Le 26/10/2012 15:24, Yohann Morille a écrit :
> Hi Fred,
>
> it is exactly what I want !
> I'm very curious to know how you have done !
> Thanks a lot,
As I previously said, I do know Mayavi, but I don't know mlab syntax
(I don't use it for my purpose; I only use mayavi as a library, to write
my own UI using Traits).

So I can send you only the mayavi script that generates the figure.

Is it ok?


PS : ktools.free.fr ;-)
(quite obsolete, though).

>
> Y.
>
> 2012/10/26 Fred <[hidden email] <mailto:[hidden email]>>
>
>     Le 23/10/2012 15:52, Yohann Morille a écrit :
>
>         OK Fred,
>         I will try following this way.
>         But first, I think that I have to extract "points" and "lines"
>         that form
>         each one of my two spheres (those represented when I use the
>         wireframe
>         representation) and I can not do.
>         Can I do that with:
>         edges = mlab.pipeline.extract_edges(__outer1)
>         ?
>
>         Youm
>
>
>
>     Youm,
>
>     Does it answer to your needs ?
>
>
>
>
>         2012/10/22 Fred <[hidden email]
>         <mailto:[hidden email]> <mailto:[hidden email]
>         <mailto:[hidden email]>>>
>
>              Le 22/10/2012 14:48, Yohann Morille a écrit :
>          > Hi Pietro,
>          >
>          > this is exactly what I wanted.
>          > Thanks for your answer.
>
>              Mmmh, I would try with the DataSetClipper filter...
>
>          > Youm
>          >
>          > 2012/10/22 Pietro Berkes <[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>          > <mailto:[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>__>>
>          >
>          >     Hi Youm,
>          >
>          >     if I understand correctly, you would like to compute the
>         internal
>          >     part of the union of the two spheres (or any other object
>         you may
>          >     have), and remove the wireframe points that belong to the
>          >     intersection, is that correct? As far as I know, there is
>              nothing in
>          >     mayavi that would allow you to do this out-of-the-box.
>          >
>          >     All the best,
>          >     Pietro
>          >
>          >
>          >     On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille
>          > <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email]__com
>         <mailto:[hidden email]>>
>         <mailto:[hidden email]__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]__com
>         <mailto:[hidden email]>>>>
>              wrote:
>          >
>          >         Hi,
>          >
>          >         I am trying to display only the outer surface of 2
>              overlapping
>          >         glyphs.
>          >
>          >         Starting from this example:
>          >
>          >         ##############################__##
>          >         from mayavi import mlab
>          >         import numpy as np
>          >
>          >         mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
>          >         mlab.clf()
>          >
>          >         pts1 = np.array([0, 0, 1])
>          >         pts2 = np.array([1, 1, 0])
>          >
>          >
>          >         outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2],
>          >         scale_factor=2.5  ,resolution=20,color=(1, 0,
>         0),opacity=0.3)
>          >         outer1.actor.property.__representation = 'wireframe'
>          >         outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2],
>          >         scale_factor=2.5  ,resolution=20,color=(0, 1,
>         0),opacity=0.3)
>          >         outer2.actor.property.__representation = 'wireframe'
>          >
>          >         mlab.show()
>          >         ##############################__#
>          >
>          >         I want the same but with no wireframe where glyphs
>              (outer1 and
>          >         outer2) are overlapping.
>          >         Is it possible ?
>          >         Thanks !
>          >
>          >         Youm
>          >
>          >
>          >
>          >         _________________________________________________
>          >         Enthought-Dev mailing list
>          > [hidden email].__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]__enthought.com
>         <mailto:[hidden email]>>
>          > <mailto:[hidden email]__enthought.com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]__enthought.com
>         <mailto:[hidden email]>>>
>          > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>          >
>          >
>          >
>          >
>          >     --
>          >     Pietro Berkes
>          >     Scientific software developer
>          >     Enthought UK
>          >
>          >
>          >
>          >     _________________________________________________
>          >     Enthought-Dev mailing list
>          > [hidden email].__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]__enthought.com
>         <mailto:[hidden email]>>
>          > <mailto:[hidden email]__enthought.com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]__enthought.com
>         <mailto:[hidden email]>>>
>          > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>          >
>          >
>          >
>          >
>          > _________________________________________________
>          > Enthought-Dev mailing list
>          > [hidden email].__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]__enthought.com
>         <mailto:[hidden email]>>
>          > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>
>
>              --
>              Fred
>              _________________________________________________
>              Enthought-Dev mailing list
>         [hidden email].__com
>         <mailto:[hidden email]>
>         <mailto:[hidden email]__enthought.com
>         <mailto:[hidden email]>>
>         https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>
>
>
>
>         _________________________________________________
>         Enthought-Dev mailing list
>         [hidden email].__com
>         <mailto:[hidden email]>
>         https://mail.enthought.com/__mailman/listinfo/enthought-dev
>         <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>
>
>
>     --
>     Fred
>
>     _______________________________________________
>     Enthought-Dev mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev


--
Fred
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Mayavi Display outer surface only

Fred
Le 26/10/2012 16:05, Yohann Morille a écrit :
> Of course I am !
> Thanks

Please look at the CME (Complete Minimal Example) I have attached.

Maybe there is a more trivial approach using mlab ;-)

> Y
>
> 2012/10/26 Fred <[hidden email] <mailto:[hidden email]>>
>
>     Le 26/10/2012 15:24, Yohann Morille a écrit :
>      > Hi Fred,
>      >
>      > it is exactly what I want !
>      > I'm very curious to know how you have done !
>      > Thanks a lot,
>     As I previously said, I do know Mayavi, but I don't know mlab syntax
>     (I don't use it for my purpose; I only use mayavi as a library, to write
>     my own UI using Traits).
>
>     So I can send you only the mayavi script that generates the figure.
>
>     Is it ok?
>
>
>     PS : ktools.free.fr <http://ktools.free.fr> ;-)
>     (quite obsolete, though).
>
>      >
>      > Y.
>      >
>      > 2012/10/26 Fred <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>
>      >
>      >     Le 23/10/2012 15:52, Yohann Morille a écrit :
>      >
>      >         OK Fred,
>      >         I will try following this way.
>      >         But first, I think that I have to extract "points" and
>     "lines"
>      >         that form
>      >         each one of my two spheres (those represented when I use the
>      >         wireframe
>      >         representation) and I can not do.
>      >         Can I do that with:
>      >         edges = mlab.pipeline.extract_edges(__outer1)
>      >         ?
>      >
>      >         Youm
>      >
>      >
>      >
>      >     Youm,
>      >
>      >     Does it answer to your needs ?
>      >
>      >
>      >
>      >
>      >         2012/10/22 Fred <[hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>
>     <mailto:[hidden email] <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>>>
>      >
>      >              Le 22/10/2012 14:48, Yohann Morille a écrit :
>      > > Hi Pietro,
>      > >
>      > > this is exactly what I wanted.
>      > > Thanks for your answer.
>      >
>      >              Mmmh, I would try with the DataSetClipper filter...
>      >
>      > > Youm
>      > >
>      > > 2012/10/22 Pietro Berkes <[hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email] <mailto:[hidden email]>>
>      > <mailto:[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>
>      > > <mailto:[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>
>      > <mailto:[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>__>>
>      > >
>      > >     Hi Youm,
>      > >
>      > >     if I understand correctly, you would like to compute the
>      >         internal
>      > >     part of the union of the two spheres (or any other object
>      >         you may
>      > >     have), and remove the wireframe points that belong to the
>      > >     intersection, is that correct? As far as I know, there is
>      >              nothing in
>      > >     mayavi that would allow you to do this out-of-the-box.
>      > >
>      > >     All the best,
>      > >     Pietro
>      > >
>      > >
>      > >     On Wed, Oct 17, 2012 at 2:07 PM, Yohann Morille
>      > > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>
>      > <mailto:yohann.morille@gmail. <mailto:yohann.morille@gmail.>__com
>      > <mailto:[hidden email] <mailto:[hidden email]>>>
>      > <mailto:yohann.morille@gmail. <mailto:yohann.morille@gmail.>__com
>      > <mailto:[hidden email] <mailto:[hidden email]>>
>      > <mailto:yohann.morille@gmail. <mailto:yohann.morille@gmail.>__com
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>>>>
>      >              wrote:
>      > >
>      > >         Hi,
>      > >
>      > >         I am trying to display only the outer surface of 2
>      >              overlapping
>      > >         glyphs.
>      > >
>      > >         Starting from this example:
>      > >
>      > >         ##############################__##
>      > >         from mayavi import mlab
>      > >         import numpy as np
>      > >
>      > >         mlab.figure(1, bgcolor=(0, 0, 0), size=(350, 350))
>      > >         mlab.clf()
>      > >
>      > >         pts1 = np.array([0, 0, 1])
>      > >         pts2 = np.array([1, 1, 0])
>      > >
>      > >
>      > >         outer1 = mlab.points3d(pts1[0], pts1[1], pts1[2],
>      > >         scale_factor=2.5  ,resolution=20,color=(1, 0,
>      >         0),opacity=0.3)
>      > >         outer1.actor.property.__representation = 'wireframe'
>      > >         outer2 = mlab.points3d(pts2[0], pts2[1], pts2[2],
>      > >         scale_factor=2.5  ,resolution=20,color=(0, 1,
>      >         0),opacity=0.3)
>      > >         outer2.actor.property.__representation = 'wireframe'
>      > >
>      > >         mlab.show()
>      > >         ##############################__#
>      > >
>      > >         I want the same but with no wireframe where glyphs
>      >              (outer1 and
>      > >         outer2) are overlapping.
>      > >         Is it possible ?
>      > >         Thanks !
>      > >
>      > >         Youm
>      > >
>      > >
>      > >
>      > >         _________________________________________________
>      > >         Enthought-Dev mailing list
>      > > [hidden email].__com
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > <mailto:Enthought-Dev@mail.
>     <mailto:Enthought-Dev@mail.>__enthought.com <http://enthought.com>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>>
>      > > <mailto:Enthought-Dev@mail.
>     <mailto:Enthought-Dev@mail.>__enthought.com <http://enthought.com>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > <mailto:Enthought-Dev@mail.
>     <mailto:Enthought-Dev@mail.>__enthought.com <http://enthought.com>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>>>
>      > > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>      > <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>      > >
>      > >
>      > >
>      > >
>      > >     --
>      > >     Pietro Berkes
>      > >     Scientific software developer
>      > >     Enthought UK
>      > >
>      > >
>      > >
>      > >     _________________________________________________
>      > >     Enthought-Dev mailing list
>      > > [hidden email].__com
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > <mailto:Enthought-Dev@mail.
>     <mailto:Enthought-Dev@mail.>__enthought.com <http://enthought.com>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>>
>      > > <mailto:Enthought-Dev@mail.
>     <mailto:Enthought-Dev@mail.>__enthought.com <http://enthought.com>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > <mailto:Enthought-Dev@mail.
>     <mailto:Enthought-Dev@mail.>__enthought.com <http://enthought.com>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>>>
>      > > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>      > <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>      > >
>      > >
>      > >
>      > >
>      > > _________________________________________________
>      > > Enthought-Dev mailing list
>      > > [hidden email].__com
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > <mailto:Enthought-Dev@mail.
>     <mailto:Enthought-Dev@mail.>__enthought.com <http://enthought.com>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>>
>      > > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>      > <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>      >
>      >
>      >              --
>      >              Fred
>      >              _________________________________________________
>      >              Enthought-Dev mailing list
>      >         [hidden email].__com
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > <mailto:Enthought-Dev@mail.
>     <mailto:Enthought-Dev@mail.>__enthought.com <http://enthought.com>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>>
>      > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>      > <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>      >
>      >
>      >
>      >
>      >         _________________________________________________
>      >         Enthought-Dev mailing list
>      >         [hidden email].__com
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > https://mail.enthought.com/__mailman/listinfo/enthought-dev
>      > <https://mail.enthought.com/mailman/listinfo/enthought-dev>
>      >
>      >
>      >
>      >     --
>      >     Fred
>      >
>      >     _______________________________________________
>      >     Enthought-Dev mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > <mailto:[hidden email]
>     <mailto:[hidden email]>>
>      > https://mail.enthought.com/mailman/listinfo/enthought-dev
>      >
>      >
>      >
>      >
>      > _______________________________________________
>      > Enthought-Dev mailing list
>      > [hidden email]
>     <mailto:[hidden email]>
>      > https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>     --
>     Fred
>     _______________________________________________
>     Enthought-Dev mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>
>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev

--
Fred

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

cme.py (2K) Download Attachment