# How to make the TCP follow a 3D curve for motion simulation? Can we use a 3-axis G-code?

**URL:** <https://forum.universal-robots.com/t/how-to-make-the-tcp-follow-a-3d-curve-for-motion-simulation-can-we-use-a-3-axis-g-code/21992>\
**Category:** URScript\
**Created:** [June 15, 2022, 8:35pm UTC](https://forum.universal-robots.com/t/how-to-make-the-tcp-follow-a-3d-curve-for-motion-simulation-can-we-use-a-3-axis-g-code/21992 "2022-06-15T20:35:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon12052823](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@anon12052823](https://forum.universal-robots.com/u/anon12052823)\
**Post date:** [June 15, 2022, 8:35pm UTC](https://forum.universal-robots.com/t/how-to-make-the-tcp-follow-a-3d-curve-for-motion-simulation-can-we-use-a-3-axis-g-code/21992/1 "2022-06-15T20:35:25Z")

</div>

Hi,

I am trying to simulate a motion for a project I’m working on and it requires me to trace the TCP on a 3D curve in a controlled manner throughout the path rather than connecting waypoints. The motion range is not too huge so I am not worried about the pose constraints or singularities. Imagine drawing on a 3 ft x3 ft curved whiteboard - that would be the motion space.

Since this motion is similar to that of a 3-axis CNC I am trying to figure out a way to extract the g-code from CAD/CAM software where I can sketch the 3D toolpath and export a .nc file (currently have license for SolidWorks Professional). The TCP can spin freely about z-axis so in a way I’m not restraining the pose too much. The toolpath generator provided by UR only works for 2D path (or 2.5 axis). Are there any resources I can use to export a 3-axis G-code for a curve as simple as the one below? This is my first venture into programming so any relevant inputs are appreciated.

P.S I did look into the script manual but my project involves simulating several 3D motions back to back on any given day so I am looking for a quicker/shorter turnover in creating programs.

Thanks!

 ![3D Profile](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/db83ad119109b67c12df6d8bcfc1320dcaeaa275.png)
