how can i draw
how can i draw
Hello,
I have a CSV file with force data and I want to be able to draw a circle on the ground that will be "at the foot" of an object and I want the circle to grow and decrease according to the value of the force. Is it possible to do that ?
I'm using the python API.
Thanks in advance
I have a CSV file with force data and I want to be able to draw a circle on the ground that will be "at the foot" of an object and I want the circle to grow and decrease according to the value of the force. Is it possible to do that ?
I'm using the python API.
Thanks in advance
Re: how can i draw
Yes, with sim.addDrawingObject and sim.addDrawingObjectItem
Re: how can i draw
thank you for your reply.
Is it possible to have an example ?
Is it possible to have an example ?
Re: how can i draw
Every time I try to put this function in my code I get this error :
AttributeError: module 'sim' has no attribute 'addDrawingObject'
AttributeError: module 'sim' has no attribute 'addDrawingObject'
Re: how can i draw
It is highly recommended to use the ZeroMQ remote API, since it is much easier and flexible. Additionally, you'll have access to many more API functions, than with the legacy remote API.
Re: how can i draw
For what you want to draw, you can use
sim.drawing_discpts
(to draw discs) combined with sim.drawing_itemsizes
which takes one additional number (in sim.addDrawingObjectItem) to specify the item size:Code: Select all
dwo=sim.addDrawingObject(sim.drawing_discpts|sim.drawing_itemsizes,0.1,0,-1,1000,{1,0,0})
-- pos: quat: size:
sim.addDrawingObjectItem(dwo,{0.5, 0,0, 0,0,0,1, 0.2})
sim.addDrawingObjectItem(dwo,{ 0,0.5,0, 0,0,0,1, 0.1})
sim.addDrawingObjectItem(dwo,{0.5,0.5,0, 0,0,0,1, 0.05})
Re: how can i draw
Thank you for your help.
I have another question.
With this API can I still use my previous codes made with the other API or do I have to readapt my code?
Thank you in advance for your answer
I have another question.
With this API can I still use my previous codes made with the other API or do I have to readapt my code?
Thank you in advance for your answer
Re: how can i draw
The ZMQ Remote API is a 1:1 equivalent of the (lua) Regular API.
If you used the Regular API (e.g. in model scripts), it works in the same way.
If you used the legacy Remote API you might need to make minor adjustments.
If you used the Regular API (e.g. in model scripts), it works in the same way.
If you used the legacy Remote API you might need to make minor adjustments.
Re: how can i draw
very good and I have another question.
Can I attach this obet create to another object for example I would like the circle to be created at the foot of a cane ?
Can I attach this obet create to another object for example I would like the circle to be created at the foot of a cane ?
Re: how can i draw
Yes (by passing the foot handle to the parentObjectHandle param).