csv to vcarve pro

This forum is for general discussion regarding VCarve Pro
Post Reply
jonathanmahnken
Vectric Apprentice
Posts: 58
Joined: Wed Apr 07, 2021 5:58 pm
Model of CNC Machine: warthog uccnc

csv to vcarve pro

Post by jonathanmahnken »

im sure its been asked but whats the best way to do this?

User avatar
Adrian
Vectric Archimage
Posts: 14544
Joined: Thu Nov 23, 2006 2:19 pm
Model of CNC Machine: ShopBot PRS Alpha 96x48
Location: Surrey, UK

Re: csv to vcarve pro

Post by Adrian »


jonathanmahnken
Vectric Apprentice
Posts: 58
Joined: Wed Apr 07, 2021 5:58 pm
Model of CNC Machine: warthog uccnc

Re: csv to vcarve pro

Post by jonathanmahnken »

thanks adrian. That gadget seems pretty complex no? all I would like to do is enter the dimensions of rectangles and then have them lay out in vcarve.

User avatar
dealguy11
Vectric Wizard
Posts: 2464
Joined: Tue Sep 22, 2009 9:52 pm
Model of CNC Machine: Anderson Selexx 510
Location: Henryville, PA

Re: csv to vcarve pro

Post by dealguy11 »

Only slightly more complicated. Even if you just provided dimensions, you would still have to tell it where to place the rectangle. The gadget assumes you will do that explicitly by giving two corners of the rectangle.

So,

!Rectangle, 10,10,20,20

will give you a rectangle with one corner at x10y10 and the other corner at x20y20. That single line is all you need for the rectangle.

The whole set of csv programs deals with both 2d and 3d shapes. The 2d part is fairly straightforward. You just need the gadget called "CSV to 2d vectors"
Steve Godding
Not all who wander (or wonder) are lost

jonathanmahnken
Vectric Apprentice
Posts: 58
Joined: Wed Apr 07, 2021 5:58 pm
Model of CNC Machine: warthog uccnc

Re: csv to vcarve pro

Post by jonathanmahnken »

thanks

User avatar
adze_cnc
Vectric Wizard
Posts: 4325
Joined: Sat Jul 27, 2013 10:08 pm
Model of CNC Machine: AXYZ 4008
Location: Vancouver, BC, Canada

Re: csv to vcarve pro

Post by adze_cnc »

I downloaded that gadget years ago but never had a chance to look at it. With the posting of this thread and having had some time to play with it I can foresee getting really into using it. It's going to be especially useful when linked to Rhinoceros 3D's "Grasshopper" parametric visual programming plug-in. For more on Grasshopper you can see our own TReischl's video: https://www.youtube.com/watch?v=1y_47dHqZso

One thing to watch out for with the "CSV to 2D Vectors" part of the plug-in is how it creates circles (at least in VCarve v9.519). It would be interesting to see if v10.xxx has the same problems as below.

I used the following code:

Code: Select all

!Layer,Weird Decimals
!inch
!Circle, 1, 0, 0.5
!Circle, -1, 0, 0.5
;end of circles
The way "CSV to 2D Vectors" creates a circle is by creating two arcs starting from the top and then from the bottom:
csv2D circle nodes.png
But that creates a circle whose X width is not quite what it should be:
csv2D circle size.png
The right-hand arc is OK but the left-hand arc is slightly narrower. The centre of the circle is OK too.

As a test I altered the LUA code for the gadget to draw the circle as four arcs instead of two:
csv2D quadrant circle nodes.png
With that change the size is now as it should be:
csv2D quadrant circle size.png
If you want/need to make the fix yourself then change the two c:ArcTo lines from:

Code: Select all

function CircleContour( x,y, r )
	x = Scale( SafeToNumber( x, 0.0, -1e6, 1e6 ) )
	y = Scale( SafeToNumber( y, 0.0, -1e6, 1e6 ) )
	r = Scale( SafeToNumber( r, 1.0, 0.01, 1e6 ) )

	local c = Contour( 0.0 )
	c:AppendPoint( x,y+r )
	c:ArcTo( Point2D( x,y-r ), Point2D(x,y), true )
	c:ArcTo( Point2D( x,y+r ), Point2D(x,y), true )
	return c
end
to:

Code: Select all

function CircleContour( x,y, r )
	x = Scale( SafeToNumber( x, 0.0, -1e6, 1e6 ) )
	y = Scale( SafeToNumber( y, 0.0, -1e6, 1e6 ) )
	r = Scale( SafeToNumber( r, 1.0, 0.01, 1e6 ) )

	local c = Contour( 0.0 )
	c:AppendPoint( x,y+r )
	c:ArcTo( Point2D( x-r,y ), Point2D(x,y), true )
	c:ArcTo( Point2D( x,y-r ), Point2D(x,y), true )
	c:ArcTo( Point2D( x+r,y ), Point2D(x,y), true )
	c:ArcTo( Point2D( x,y+r ), Point2D(x,y), true )
	return c
end
Steven

Post Reply