Community
Meshmixer
Welcome to Autodesk’s Meshmixer Forums. Share your knowledge, ask questions, and explore popular Meshmixer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MMAPI model - tool manipulation

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
mc_rees
585 Views, 3 Replies

MMAPI model - tool manipulation

Hey ppl!
I 'm trying to do some stuff through mmapi. Let's say I want to move a model or use a tool like plane cut. I can do rotations (create rotational matrix, etc) and I can do relative translations (a percentage of height, width etc).

What I cannot do, is input world distances to these tools, eg move plane cut by 2 mm, or translate model by 3mm.
Anyone know how I could do it?

Tags (1)
Labels (1)
3 REPLIES 3
Message 2 of 4
hfcandrew
in reply to: mc_rees

Ya turn on snap step and absolute coordinates. Read the positioning before, then move it in XYZ by your reading + 2mm etc.

Message 3 of 4
MagWeb
in reply to: mc_rees

In case of Transform tool: Moving an object 3mm in X to negative:

import mmapi
from mmRemote import *
import mm

remote = mmRemote()
remote.connect()

mm.begin_tool(remote, 'transform')
mm.set_toolparam(remote, 'translationWorld', (-3.0, 0.0, 0.0) )

#mm.accept_tool(remote)

remote.shutdown()

In case of PlaneCut you need to define the origin (some point on the cutting plane) of the tool instead (don't forget to convert World to Scene coordinates). This cuts 5mm above world origin:

mm.begin_tool(remote, 'planeCut')
pos = mm.toS(remote,(0.0, 5.0, 0.0))
mm.set_toolparam(remote, 'origin', pos)

 



Gunter Weber
Triangle Artisan

Message 4 of 4
mc_rees
in reply to: MagWeb

Thank you people!

It worked. I had to change one line, as to @MagWeb's example. I also took @hfcandrew's advice and eyeballed my distances by activating Snapping.
Thank you so much! I literally had thrown hours at this!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums