Good Day,
I'm drawing the objects on 3ds max and to have a really good quality i'm using turbosmooth x3 /x4 and after i cut to splines that have thousands of vertexes(need top quality for CNC).I need to export those splines in to dwg or dxf(preferable) . So, the splines has a lot of vertex and Corel drow/Autocad dont even open the file. I need high quality splines without segmentation like it was drew in Autocad/Coreldraw please find attached 2 photos.
1. Spline that was draw in 3ds max .
2. Spline that was draw in coreldraw.
So i need something to convert 3ds max spline to coreldraw/autocad spline, or something to delete those vertexes without loosing the shape and quality.
Maybe autodesk has other app to solve this problem?
Please need your help.
Good Day,
I'm drawing the objects on 3ds max and to have a really good quality i'm using turbosmooth x3 /x4 and after i cut to splines that have thousands of vertexes(need top quality for CNC).I need to export those splines in to dwg or dxf(preferable) . So, the splines has a lot of vertex and Corel drow/Autocad dont even open the file. I need high quality splines without segmentation like it was drew in Autocad/Coreldraw please find attached 2 photos.
1. Spline that was draw in 3ds max .
2. Spline that was draw in coreldraw.
So i need something to convert 3ds max spline to coreldraw/autocad spline, or something to delete those vertexes without loosing the shape and quality.
Maybe autodesk has other app to solve this problem?
Please need your help.
I gave some thought to this issues and hopefully have an acceptable solution.
Let's take the following spline in Max.
It was defined by 10 vertices some of which have Bezier handles and one a Bezier corner as noted below.
If we export this spline to a .dwg format and open it in AutoCAD we get the following.
The shape on the right is a copy of the imported "spline" but it's selected to show the vertices. In fact, the shape is not a spline but a polyline with many vertices.
The goal is to import into AutoCAD splines that retain the precision of the Max spline.
We can consider the Max spline to be a B-spline which is a special case of the more general NURBS (Non-Uniform Rational B-Spline). A B-spline is in essence a series of Bezier splines positioned head to tail.
The following Maxscript will create an AutoCAD script file that defines a set of 3rd degree Bezier splines that exactly represent their Max spline source. After executing the Maxscript the user should run resulting AutoCAD script in AutoCAD. Each Max spline will be represented as a series of 3rd degree spline each have 4 CVs (Control vertices).
For example, here's our Max spline (and a copy) as it looks in AutoCAD after running the script.
In this example the original Max spline with 10 vertices (Fit points in AutoCAD terminology) is defined by 9 Bezier splines. The Join command can be used to make one AutoCAD spline from these curves.
It should be noted that if you use a crude step size in Max for the spline such as here:
The resulting exported spline may look not tooo smooth. If it does just use regen to smooth it out. Since the curve is a true spline it's smoothness is not limited by the number of points.
Here's the Maxscript.
-- Creates an AutoCAD script file of Bezier splines from a selected splines.
-- Max spline (line). It assumes the Max spline is a degree 3 B-spline or a NURBS
-- with a weight of 1 for all knots.
-- Run the script in AuotCAD and then use Join to make them one spline.
-- The splines must be selected before execution.
-- L. Minardi 4/17/2021
--
spl = selection as array
max modify mode
messageBox ("\nInclude .scr when specifying file name.")
outputFile = getSaveFileName()
if outputFile != undefined then
(outputFile = createfile outputFile)
nObj = selection.count
format "(setvar 'osmode 0)\n" to: outputFile
if selection.count != 0 do
(
for o in spl where classOf o == line do
(
n = numknots o
for k = 1 to (n - 1) do
(
format "(initcommandversion)\n" to: outputFile
format "spline m cv\n" to:outputFile
format "%,%,%\n" (getKnotPoint o 1 k).x (getKnotPoint o 1 k).y (getKnotPoint o 1 k).z to:outputFile
out_vec = getOutVec o 1 k
format "%,%,%\n" out_vec.x out_vec.y out_vec.z to: outputFile
in_vec = getInVec o 1 (k + 1)
format "%,%,%\n" in_vec.x in_vec.y in_vec.z to: outputFile
format "%,%,%\n" (getKnotPoint o 1 (k + 1)).x (getKnotPoint o 1 (k + 1)).y (getKnotPoint o 1 (k + 1)).z to:outputFile
format "\n" to: outputFile
)
)
)
format "\nDone\n"
close outputFile
Here's a sample of the script file (.scr) generated by the Maxscript.
(setvar 'osmode 0)
(initcommandversion)
spline m cv
505.678,-24.2409,0.0
520.24,16.9423,0.0
537.078,37.4201,0.0
556.19,37.1926,0.0
(initcommandversion)
spline m cv
556.19,37.1926,0.0
575.303,36.965,0.0
600.786,-26.5162,0.0
620.354,-25.606,0.0
(initcommandversion)
spline m cv
620.354,-25.606,0.0
639.922,-24.6959,0.0
656.077,42.8809,0.0
673.596,42.6533,0.0
(initcommandversion)
spline m cv
673.596,42.6533,0.0
... etc
Coreldraw supports B-splines but although it may not support NURBS (AutoCAD splines). However, if the weight factors of all the vertices of the AutoCAD spline are 1 then the spline can be considered a B-spline and the spline produced with this script should be compatible.
I gave some thought to this issues and hopefully have an acceptable solution.
Let's take the following spline in Max.
It was defined by 10 vertices some of which have Bezier handles and one a Bezier corner as noted below.
If we export this spline to a .dwg format and open it in AutoCAD we get the following.
The shape on the right is a copy of the imported "spline" but it's selected to show the vertices. In fact, the shape is not a spline but a polyline with many vertices.
The goal is to import into AutoCAD splines that retain the precision of the Max spline.
We can consider the Max spline to be a B-spline which is a special case of the more general NURBS (Non-Uniform Rational B-Spline). A B-spline is in essence a series of Bezier splines positioned head to tail.
The following Maxscript will create an AutoCAD script file that defines a set of 3rd degree Bezier splines that exactly represent their Max spline source. After executing the Maxscript the user should run resulting AutoCAD script in AutoCAD. Each Max spline will be represented as a series of 3rd degree spline each have 4 CVs (Control vertices).
For example, here's our Max spline (and a copy) as it looks in AutoCAD after running the script.
In this example the original Max spline with 10 vertices (Fit points in AutoCAD terminology) is defined by 9 Bezier splines. The Join command can be used to make one AutoCAD spline from these curves.
It should be noted that if you use a crude step size in Max for the spline such as here:
The resulting exported spline may look not tooo smooth. If it does just use regen to smooth it out. Since the curve is a true spline it's smoothness is not limited by the number of points.
Here's the Maxscript.
-- Creates an AutoCAD script file of Bezier splines from a selected splines.
-- Max spline (line). It assumes the Max spline is a degree 3 B-spline or a NURBS
-- with a weight of 1 for all knots.
-- Run the script in AuotCAD and then use Join to make them one spline.
-- The splines must be selected before execution.
-- L. Minardi 4/17/2021
--
spl = selection as array
max modify mode
messageBox ("\nInclude .scr when specifying file name.")
outputFile = getSaveFileName()
if outputFile != undefined then
(outputFile = createfile outputFile)
nObj = selection.count
format "(setvar 'osmode 0)\n" to: outputFile
if selection.count != 0 do
(
for o in spl where classOf o == line do
(
n = numknots o
for k = 1 to (n - 1) do
(
format "(initcommandversion)\n" to: outputFile
format "spline m cv\n" to:outputFile
format "%,%,%\n" (getKnotPoint o 1 k).x (getKnotPoint o 1 k).y (getKnotPoint o 1 k).z to:outputFile
out_vec = getOutVec o 1 k
format "%,%,%\n" out_vec.x out_vec.y out_vec.z to: outputFile
in_vec = getInVec o 1 (k + 1)
format "%,%,%\n" in_vec.x in_vec.y in_vec.z to: outputFile
format "%,%,%\n" (getKnotPoint o 1 (k + 1)).x (getKnotPoint o 1 (k + 1)).y (getKnotPoint o 1 (k + 1)).z to:outputFile
format "\n" to: outputFile
)
)
)
format "\nDone\n"
close outputFile
Here's a sample of the script file (.scr) generated by the Maxscript.
(setvar 'osmode 0)
(initcommandversion)
spline m cv
505.678,-24.2409,0.0
520.24,16.9423,0.0
537.078,37.4201,0.0
556.19,37.1926,0.0
(initcommandversion)
spline m cv
556.19,37.1926,0.0
575.303,36.965,0.0
600.786,-26.5162,0.0
620.354,-25.606,0.0
(initcommandversion)
spline m cv
620.354,-25.606,0.0
639.922,-24.6959,0.0
656.077,42.8809,0.0
673.596,42.6533,0.0
(initcommandversion)
spline m cv
673.596,42.6533,0.0
... etc
Coreldraw supports B-splines but although it may not support NURBS (AutoCAD splines). However, if the weight factors of all the vertices of the AutoCAD spline are 1 then the spline can be considered a B-spline and the spline produced with this script should be compatible.
Can't find what you're looking for? Ask the community or share your knowledge.