I need to programmatically create a CAD model. Meaning: The user sets parameters for the model and the application outputs a (insert extension here) file to use in SolidWorks / 3DStudio / Sketchup.
The application generates shells (a tube, for example) with changing radiuses and I would like visualize the shells generated externally, usually in SolidWorks. I suppose it's something like the output of this robot.
I'm not completely sure about the output I need, I need to test a few options. So I'm looking for the technical solution. A good output file to start with will be a tube with a constant external radius, but the internal radius changes with Z (or the other way around).
In SolidWorks, I'd create a spline and use 'Revolved Boss' to extrude it to a shape. Then create another spline and use 'Revolved Cut' to remove the center, like in this picture (Red - the outline of the pipe - the outer radius. Green - The outline of the inner radius):
(This example is on a tube but the shapes (the intersections) are not really limited, they always consist of geometrical shapes though)
So, my questions are:
- Is there an (free if possible) infrastructure to do exactly that? Revloved boss and Revolved Cut?
- Does this infrastructure has an option to export to CAD files?
- I think I'm using solid modelling - am I?
- Should I just create a points cloud (model many intersections and join them together)? Which file format should I use then?
The main use will be for working with solidworks. I'm using C#, but anything goes.
I'm sorry for the vague question - I'm pretty new in CADing from code.
I ended up using Eyeshot SDK. The alternatives I tried:
Eyeshot has a pretty simple SDK that is usable straight from C#. The documentation is awful, and I spent way too much time trying to figure out the exception it threw - But it has good code samples. And it's okay once you get to know it. A tad expensive though.
I'm still working on the SolidWorks export. Eyeshot supports STL, IGEN, OBJ, and STEP - Solidworks handles them all okay, but the surfaces are not smooth (circles are not circles just many polygons). As I said - still at work.
Anyway, for future references - Here is some code samples that create something similar (outer radius is constant, inner radius changing) to what I described in the question (Check out one of the samples, like Lego, for how to use WorkUnit):