Need Help! convert a 3d spline to gcode to control a camera movement


Results 1 to 14 of 14

Thread: convert a 3d spline to gcode to control a camera movement

  1. #1

    Default convert a 3d spline to gcode to control a camera movement

    Hello I am building a camera controller system to control my dslr when I do stop motion videos. I want to make a path (a 3d spline made in cinema 4d) for the camera to follow. I tried to make a helix (like a spring, just a spline) and then exported it as .dxf. I now need to get the coordinates for the vertices in the spline to make a gcode for mach3... I tried to export it as .dxf and then convert it to gcode in lazycam but I have realized that this and many other cam software don´t work in 3d, just 2d and then I can choose the cutting deep. I have also understood that the 3d cam software's rather want to have a "3d model" to convert to gcode and not just a 3dspline. I thought this problem could be solved by just a plugin to cinema 4d or so to export the splines just gcode because I just need the coordinates not any info about cutting speed, tools, etc. If anyone have an idea please help me.

    Similar Threads:


  2. #2
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: convert a 3d spline to gcode to control a camera movement

    I have an AutoCAD macro that can export g-code from a 3D polyline. If you post your .dxf, I'll see if I can get you the coordinates. They'd be in g-code format.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3

    Default Re: convert a 3d spline to gcode to control a camera movement

    Ok, well that sounds good! I hope the .dxf is attached.

    Attached Files Attached Files


  4. #4
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: convert a 3d spline to gcode to control a camera movement

    The helix is wrapped around the Y axis. Is that what you want, or do you want it around the Z axis?

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  5. #5

    Default

    Well you can flipp it If you want it is just
    a test to see if it works.

    Best regards flyingpickles



  6. #6
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: convert a 3d spline to gcode to control a camera movement

    Here you go. I rotated it around the Z axis.

    X2.0000 Y0.0000 Z0.0000
    X1.9842 Y0.2507 Z0.0200
    X1.9646 Y0.3748 Z0.0300
    X1.9372 Y0.4974 Z0.0400
    X1.9021 Y0.6180 Z0.0500
    X1.8596 Y0.7362 Z0.0600
    X1.8097 Y0.8516 Z0.0700
    X1.7526 Y0.9635 Z0.0800
    X1.6887 Y1.0717 Z0.0900
    X1.6180 Y1.1756 Z0.1000
    X1.5410 Y1.2748 Z0.1100
    X1.4579 Y1.3691 Z0.1200
    X1.3691 Y1.4579 Z0.1300
    X1.2748 Y1.5410 Z0.1400
    X1.1756 Y1.6180 Z0.1500
    X1.0717 Y1.6887 Z0.1600
    X0.9635 Y1.7526 Z0.1700
    X0.8516 Y1.8097 Z0.1800
    X0.7362 Y1.8595 Z0.1900
    X0.6180 Y1.9021 Z0.2000
    X0.4974 Y1.9372 Z0.2100
    X0.3748 Y1.9646 Z0.2200
    X0.2507 Y1.9842 Z0.2300
    X0.1256 Y1.9961 Z0.2400
    X0.0000 Y2.0000 Z0.2500
    X-0.1256 Y1.9961 Z0.2600
    X-0.2507 Y1.9842 Z0.2700
    X-0.3748 Y1.9646 Z0.2800
    X-0.4974 Y1.9372 Z0.2900
    X-0.6180 Y1.9021 Z0.3000
    X-0.7362 Y1.8595 Z0.3100
    X-0.8516 Y1.8097 Z0.3200
    X-0.9635 Y1.7526 Z0.3300
    X-1.0717 Y1.6887 Z0.3400
    X-1.1756 Y1.6180 Z0.3500
    X-1.2748 Y1.5410 Z0.3600
    X-1.3691 Y1.4579 Z0.3700
    X-1.4579 Y1.3691 Z0.3800
    X-1.5410 Y1.2748 Z0.3900
    X-1.6180 Y1.1756 Z0.4000
    X-1.6887 Y1.0717 Z0.4100
    X-1.7526 Y0.9635 Z0.4200
    X-1.8097 Y0.8516 Z0.4300
    X-1.8596 Y0.7362 Z0.4400
    X-1.9021 Y0.6180 Z0.4500
    X-1.9372 Y0.4974 Z0.4600
    X-1.9646 Y0.3748 Z0.4700
    X-1.9842 Y0.2507 Z0.4800
    X-1.9960 Y0.1256 Z0.4900
    X-2.0000 Y0.0000 Z0.5000
    X-1.9960 Y-0.1256 Z0.5100
    X-1.9842 Y-0.2507 Z0.5200
    X-1.9646 Y-0.3748 Z0.5300
    X-1.9372 Y-0.4974 Z0.5400
    X-1.9021 Y-0.6180 Z0.5500
    X-1.8596 Y-0.7362 Z0.5600
    X-1.8097 Y-0.8516 Z0.5700
    X-1.7526 Y-0.9635 Z0.5800
    X-1.6887 Y-1.0717 Z0.5900
    X-1.6180 Y-1.1756 Z0.6000
    X-1.5410 Y-1.2748 Z0.6100
    X-1.4579 Y-1.3691 Z0.6200
    X-1.3691 Y-1.4579 Z0.6300
    X-1.2748 Y-1.5410 Z0.6400
    X-1.1756 Y-1.6180 Z0.6500
    X-1.0717 Y-1.6887 Z0.6600
    X-0.9635 Y-1.7526 Z0.6700
    X-0.8516 Y-1.8097 Z0.6800
    X-0.7362 Y-1.8595 Z0.6900
    X-0.6180 Y-1.9021 Z0.7000
    X-0.4974 Y-1.9372 Z0.7100
    X-0.3748 Y-1.9646 Z0.7200
    X-0.2507 Y-1.9842 Z0.7300
    X-0.1256 Y-1.9961 Z0.7400
    X0.0000 Y-2.0000 Z0.7500
    X0.1256 Y-1.9961 Z0.7600
    X0.2507 Y-1.9842 Z0.7700
    X0.3748 Y-1.9646 Z0.7800
    X0.4974 Y-1.9372 Z0.7900
    X0.6180 Y-1.9021 Z0.8000
    X0.7362 Y-1.8595 Z0.8100
    X0.8516 Y-1.8097 Z0.8200
    X0.9635 Y-1.7526 Z0.8300
    X1.0717 Y-1.6887 Z0.8400
    X1.1756 Y-1.6180 Z0.8500
    X1.2748 Y-1.5410 Z0.8600
    X1.3691 Y-1.4579 Z0.8700
    X1.4579 Y-1.3691 Z0.8800
    X1.5410 Y-1.2748 Z0.8900
    X1.6180 Y-1.1756 Z0.9000
    X1.6887 Y-1.0717 Z0.9100
    X1.7526 Y-0.9635 Z0.9200
    X1.8097 Y-0.8516 Z0.9300
    X1.8596 Y-0.7362 Z0.9400
    X1.9021 Y-0.6180 Z0.9500
    X1.9372 Y-0.4974 Z0.9600
    X1.9646 Y-0.3748 Z0.9700
    X1.9842 Y-0.2507 Z0.9800
    X1.9960 Y-0.1256 Z0.9900
    X2.0000 Y0.0000 Z1.0000
    X1.9960 Y0.1256 Z1.0100
    X1.9842 Y0.2507 Z1.0200
    X1.9646 Y0.3748 Z1.0300
    X1.9372 Y0.4974 Z1.0400
    X1.9021 Y0.6180 Z1.0500
    X1.8596 Y0.7362 Z1.0600
    X1.8097 Y0.8516 Z1.0700
    X1.7526 Y0.9635 Z1.0800
    X1.6887 Y1.0717 Z1.0900
    X1.6180 Y1.1756 Z1.1000
    X1.5410 Y1.2748 Z1.1100
    X1.4579 Y1.3691 Z1.1200
    X1.3691 Y1.4579 Z1.1300
    X1.2748 Y1.5410 Z1.1400
    X1.1756 Y1.6180 Z1.1500
    X1.0717 Y1.6887 Z1.1600
    X0.9635 Y1.7526 Z1.1700
    X0.8516 Y1.8097 Z1.1800
    X0.7362 Y1.8595 Z1.1900
    X0.6180 Y1.9021 Z1.2000
    X0.4974 Y1.9372 Z1.2100
    X0.3748 Y1.9646 Z1.2200
    X0.2507 Y1.9842 Z1.2300
    X0.1256 Y1.9961 Z1.2400
    X0.0000 Y2.0000 Z1.2500
    X-0.1256 Y1.9961 Z1.2600
    X-0.2507 Y1.9842 Z1.2700
    X-0.3748 Y1.9646 Z1.2800
    X-0.4974 Y1.9372 Z1.2900
    X-0.6180 Y1.9021 Z1.3000

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  7. #7

    Default Re: convert a 3d spline to gcode to control a camera movement

    YES!! it works perfectly. What macro did you use to generate the gcode?



  8. #8
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: convert a 3d spline to gcode to control a camera movement

    This one that I wrote.
    The CNC Woodworker - AutoCAD 2 G-Code

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  9. #9

    Default Re: convert a 3d spline to gcode to control a camera movement

    Hello, now I have tested your macro and yes it works just as I want it to work so big thanks for that! The next question is: do you know a good way to make the polygon lines with a specific number of vertexes in an easy way? When I do a camera path, every line in mach3 will be a position for the camera to stand still and take a photo. So if I want a rotation around an object for 10 seconds and the final result shall be 24 fps then the polygon line shall have 240 vertexes. And I want the software to do it automatic, like just enter the number of vertexes for a line so they get the same distance
    between them so I don´t need to add vertexes manually to the line. Or if it is possible to make this with your macro but as I have get it it makes one g-code line for every vertex.

    best regards: flyingpickles



  10. #10
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: convert a 3d spline to gcode to control a camera movement

    If it was me, I would write a VBA macro to create the polyline.
    I don't know of any built in automated methods.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  11. #11
    Member
    Join Date
    Jan 2007
    Location
    usa
    Posts
    1795
    Downloads
    0
    Uploads
    0

    Default Re: convert a 3d spline to gcode to control a camera movement

    with gcode, you can use individual line segments and add on each end a delay..
    in milliseconds.. then you need to set ""federate"" to synchronizing with camera

    so it will move from point to point and wait till camera shoot..

    you also can use M command what turns on off spindles, so that command could initiate the shoot

    of course there are automatized way too.. but im not a programmer..



  12. #12

    Default Re: convert a 3d spline to gcode to control a camera movement

    Hello well that could be a way, but I think that would be difficult in my case because I am going to use 8 axis (X,Y,Z) for one computer and pan, tilt, roll, focus and zoom with another computer so I will control the system with two computers which I will control with a third one that has a mouse movement macro recorded that makes the two computers with mach3 go to the next line in the gcode. This is done with a network remote software. The third computer is also the one that will handle the app for taking photos. So because there are two computers with mach3 I need to have full control over the amount of vertices so I can sync the movements to each other.



  13. #13
    Registered Mhoppe's Avatar
    Join Date
    Oct 2014
    Location
    USA
    Posts
    35
    Downloads
    0
    Uploads
    0

    Default Re: convert a 3d spline to gcode to control a camera movement

    Quote Originally Posted by flyingpickles View Post
    Hello well that could be a way, but I think that would be difficult in my case because I am going to use 8 axis (X,Y,Z) for one computer and pan, tilt, roll, focus and zoom with another computer so I will control the system with two computers which I will control with a third one that has a mouse movement macro recorded that makes the two computers with mach3 go to the next line in the gcode. This is done with a network remote software. The third computer is also the one that will handle the app for taking photos. So because there are two computers with mach3 I need to have full control over the amount of vertices so I can sync the movements to each other.
    I would look at NCplot. It will visualize the toolpath and if you input fanuc macro b, it will generate the raw gcode for you as well. The macro itself for a helix is fairly simple, I or someone else here could write it if you need a hand. Or as someone else suggested, a VBA macro would work. I believe Ncplot also can do something with a DXF but I haven't messed around with that feature much myself. To control the number vertices, you would simply need to define the angular sweep of the profile and divide that number by the desired number of vertices to obtain the rotation per segment.



  14. #14
    Member
    Join Date
    Jan 2007
    Location
    usa
    Posts
    1795
    Downloads
    0
    Uploads
    0

    Default Re: convert a 3d spline to gcode to control a camera movement

    he need a lot more than a simple helix gcoded...

    might be a way to hack a cheap quadrocopter control.. that can tilt n rotate camera also has plus channels for controlling the rotors



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

convert a 3d spline to gcode to control a camera movement

convert a 3d spline to gcode to control a camera movement