The easiest thing to do for cones, spheres, and cylinders is to represent
them as types of glyphs produced by mlab.points3d.  These have positional
and scale attributes which can easily be modified.  Modifying their
orientation is also possible (i.e. s.actor.actor.orientation) -- but will
require some additional math translation to get everything aligned
correctly.

Torii may be a little bit trickier.  It may be that the ParametricSource is
the easiest way to generate a torus and then you can find ways to wrap the
attributes you need.  I'm not sure.  If you only need to ever adjust them
in a gross way with only the parameters you just mentioned, the hack of
modifying s.children[0].children[0].actor.actor.origin (and
s.chldren[0].children[0].actor.actor.orientation) might be reasonable.
There also may be some vtk source that somebody has written that does a
nicer job that you could just use instead.


On Mon, Dec 16, 2013 at 4:36 PM, Jason Moore <moorepa...@gmail.com> wrote:

> Sorry, default isn't to reply all on this list.
>
> Jason
> moorepants.info
> +01 530-601-9791
>
>
> ---------- Forwarded message ----------
> From: Jason Moore <moorepa...@gmail.com>
> Date: Mon, Dec 16, 2013 at 4:34 PM
> Subject: Re: [MayaVi-users] How to transform and rotate parametric
> surfaces?
> To: Roan LaPlante <aestri...@gmail.com>
>
>
> I just want a quick way to draw primitives (tori, spheres, cones,
> cylinders) in a scene with particular dimensions and be able to rotate and
> translate them with respect to other objects I've created with mlab.mesh.
>
> Ideally I'd like something like:
>
> torus = mlab.Torus()
> torus.center = [2., 3., 4.]
> torus.orientation = [[0.1, 0.1, 0],
>                             [0.2, 0.3, 0],
>                             [0, 0, 1]]
> torus.ring_radius = 5.0
> torus.cross_section_radius = 0.2
> mlab.show()
>
> Does the tvtk or mayavi api offer anything like this?
>
>
>
> Jason
> moorepants.info
> +01 530-601-9791
>
>
> On Mon, Dec 16, 2013 at 4:21 PM, Roan LaPlante <aestri...@gmail.com>wrote:
>
>> Hi Jason,
>>
>>
>> What are you trying to do?  In general, mayavi does not have universal
>> and easily manipulable concepts of what space its visualizations occupy.
>> Rather, sources occupy some space, and different sources vary extensively
>> in how easily they are manipulated (mostly because they are not very
>> featureful sources in vtk, and all mayavi does is wrap the vtk source).
>>
>> However, in general if you're unsatisfied with the API that mayavi
>> provides you to work with your visualizations, its almost always possible
>> to hack these further and effectively do some vtk programming.  For
>> instance, if you wanted to displace this torus in the x,y,z plane, you
>> could edit the s.children[0].children[0].actor.actor.origin trait.
>>
>>
>> R
>>
>>
>> On Mon, Dec 16, 2013 at 3:19 PM, Jason Moore <moorepa...@gmail.com>wrote:
>>
>>> I've created torus like so:
>>>
>>> from mayavi import mlab
>>> s = mlab.pipeline.parametric_surface()
>>> s.function = 'torus'
>>>
>>> And can change it's geometry like:
>>>
>>> s.parametric_function.ring_radius = 10.0
>>>
>>> But how do I transform and locate the object in the main coordinate
>>> system? I can't seem to figure this out...
>>>
>>> Jason
>>> moorepants.info
>>> +01 530-601-9791
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Rapidly troubleshoot problems before they affect your business. Most IT
>>> organizations don't have a clear picture of how application performance
>>> affects their revenue. With AppDynamics, you get 100% visibility into
>>> your
>>> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
>>> AppDynamics Pro!
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> MayaVi-users mailing list
>>> MayaVi-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/mayavi-users
>>>
>>>
>>
>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> MayaVi-users mailing list
> MayaVi-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mayavi-users
>
>
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
MayaVi-users mailing list
MayaVi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to