Nirtec Studio Forum

General Category => Machines Simulator => Topic started by: KCP_Robin on September 29, 2015, 02:50:15 AM

Title: Joint Code
Post by: KCP_Robin on September 29, 2015, 02:50:15 AM
Hello Everyone, I'm trying to connect box index [1] and box index[3] using Joint.. but i can't seem to perfectly match them..
It's purpose is to connect the Arm and the jib conveyor. so when the user press "Up/Down" the Arm will go up and down so as the conveyor.. attached file for editing purposes.. Thank you very much..
I've read the manual for joint but i can't understand how the axis work and positioning .. Any help will be appreciated...  ;D
Title: Re: Joint Code
Post by: KCP_Robin on September 30, 2015, 04:29:06 AM
anyone?  ;D
Title: Re: Joint Code
Post by: EasyPLC_Master on September 30, 2015, 09:42:58 AM
Due your component uses customized models is diffucult to have an idea about how it looks or what behaviour must to have.
Please can you use standar box models and resend?
Title: Re: Joint Code
Post by: KCP_Robin on October 01, 2015, 02:16:44 AM
Here master, please have a look.. I need my Conveyor goes Up and Down together with the Arm to deliver the part... Thank you in advance
Title: Re: Joint Code
Post by: EasyPLC_Master on October 01, 2015, 11:38:57 AM
Here is attached the solution.

Points of interest:


The Union Joint are very easy to use, you only must to set the body origin (where to attach) and the body attached. Then move the origin element by code and the attached will be responsible to physics, otherwise the physics doesn't recognize the code forces.
Title: Re: Joint Code
Post by: KCP_Robin on October 02, 2015, 01:57:46 AM
Thank you very much.. will have a  thorough look on this ..  ;D
Title: Re: Joint Code
Post by: KCP_Robin on October 02, 2015, 02:00:19 AM
Quote from: EasyPLC_Master on October 01, 2015, 11:38:57 AM
Here is attached the solution.

Points of interest:


  • The Draw() method should be used to drawing routines, for other logic is better Update()
  • Try to locate the main object to move in the center of coordinates, then the logic is easiest
  • Avoid to rotate elements that later must be moved, use the scale properties (see as I have cancelled the rotation by changing X,Z)

The Union Joint are very easy to use, you only must to set the body origin (where to attach) and the body attached. Then move the origin element by code and the attached will be responsible to physics, otherwise the physics doesn't recognize the code forces.

Thank you master, I just used the Barrier.cmp on making this idea..  ;)
Title: Re: Joint Code
Post by: EasyPLC_Master on October 02, 2015, 08:06:48 AM
The Barrier.cmp uses a little trick, to avoid translate & rotate the barrier arm, the center of the arm model is not located at the center, is located in the joint point with the base where has to rotate, then the logic is easiest.
Also only have a graphical use, the arm will not be integrated in the physics system.

ADVICE:
Remember that you can locate the center of coordinates of your model in the place you want, then you can orbit (Translate & Rotate) the component in a very easy way (using simple functions like Translate or Rotate) and not using Matrix calculations.
Title: Re: Joint Code
Post by: ivanrodyk on January 05, 2026, 05:05:56 AM
What is .cmp file? how to us it?
Title: Re: Joint Code
Post by: EasyPLC_Master on January 05, 2026, 10:32:49 AM
Barrier.udc I mean, you can download here ->
https://marketplace.nirtec.com/products/barrier/ (https://marketplace.nirtec.com/products/barrier/)