MakerBot Print is our newest print-prepration software, which supports native CAD files and STL assemblies,
allows you to interact with all your printers via the Cloud, and many other exciting new features.

Download Now

Try open this file, preview or render failed, what's wrong??

Please Login to Comment

projection() {rotate([0,90,0])
linear_extrude(center = true, convexity = 10, height = 2, slices = 500, twist = -720.0000000000) {
polygon(paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]], points = [[5.0000000000, 0.0000000000], [-4.1720501029, -2.7049938569], [2.0177390834, 4.5140070730], [0.7584029619, -4.8578221518], [-3.2605860792, 3.6427754512], [4.6908070829, -1.2754333166], [-4.6033294053, -1.4732513353], [3.0434506148, 3.7189746642], [-0.5274057206, -4.7485791243], [-2.1283496766, 4.2464841521], [4.0720613414, -2.3911710830], [-4.6898477069, -0.2076947943], [3.7995111958, 2.7095188597], [-1.7038236718, -4.3146581578], [-0.9121403690, 4.5199939852], [3.2048995297, -3.2765169691], [-4.4445335361, 0.9996039548], [4.2470317943, 1.5695517013], [-2.6930703108, -3.6051868608], [-4.1720501029, -2.7049938569], [2.0177390834, 4.5140070730], [0.7584029619, -4.8578221518], [-3.2605860792, 3.6427754512], [4.6908070829, -1.2754333166], [-4.6033294053, -1.4732513353], [3.0434506148, 3.7189746642], [-0.5274057206, -4.7485791243], [-2.1283496766, 4.2464841521], [4.0720613414, -2.3911710830], [-4.6898477069, -0.2076947943], [3.7995111958, 2.7095188597], [-1.7038236718, -4.3146581578], [-0.9121403690, 4.5199939852], [3.2048995297, -3.2765169691], [-4.4445335361, 0.9996039548], [4.2470317943, 1.5695517013]]);

I tried it with


instead of the default and got the following error:

ERROR: CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e->incident_sface() != SFace_const_handle() File: /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_const_decorator.h Line: 329

I had hoped that taking a slice of it this way might give you the sort of result you are looking for.

Do you think it would if it had worked?

Here is what I guess it would look like if the code you have written runs, right?
(For this view I'm running everything but the projection() and just taking a top-down view)

yes,It is just the screenshot, i want to the section of this object!

I ran the following code using a metric screw model from the BOSL library as follows

  metric_bolt(size=10, l=15, details=true, $fn=32);

See the attached result. If I understand correctly this is the sort of result you expect and want from your own model.
Is that correct?
If so, i think your concept is fine, but I'm unable to help you with your particular model and how to simplify or correct it such that OpenSCAD can process it well. For reference, the code above produced a preview in about 10 seconds.

Sorry to keep adding replies; I am afraid to edit previous one too much or they'll get flagged for moderation. (Grr)

To answer my previous question about whether setting cut=true in your projection would also work, I tried it with my BOSL screw example.
It does work OK with a properly modeled threaded rod.
Here is my test code, this time with the required use and include statements for the library.

include <BOSL/constants.scad>
use <BOSL/metric_screws.scad>

  metric_bolt(size=10, l=15, details=true, $fn=32);

Let me know if any of this helps. Maybe you can look at generating your required thread models using a library like BOSL?

Thank you, I also used your BOSL library, and it was successful. I am learning to apply Python to implement openscad, study and evaluate several common thread models. This is the first thread modeling solution, coming from the MCAD library, however I unable to intercept the section, thank you again.

Ask another question, how to measure the point-to-point distance in openscad, is there a good way?

Sorry, I'm no expert, so maybe someone else will give you a better answer. But, I guess it depends on how you get your points. You can easily use the distance formula if you know coordinates of course. But I don't think you are going to do this in OpenSCAD itself. If you are using python to drive OpenSCAD, you might do it there. If you are intending to take a flat cross section like you generated above and visually process it, I would suggest you look at the OpenCV library. I haven't used it much except a little back when I mentored a FIRST Robotics team and we did some vision processing in LabView, but I'm sure the Python integration with OpenCV is very good.
Good luck! I'm about to doze off, so I won't be posting again for a while.
But maybe someone here can pick this up where I leave off.

its many times intersecting - is that really intentional? you cant print that as-is.

If you extrude and turn the object and then project, you wont see any inner holes anymore. At 500 slices (a lot) and 700 degrees turn, you would just get a circle in the projection.

if you project, its a 2D object, not 3D. Depending on your openscad version, you might not see 2D objects

In all, im really puzzled what you want to achieve by this code...

This is a 3d thread model, I want a section that measures related parameters such as pitch, outer diameter, inner diameter, etc.Do you have a better way?

well.......rotate([0,90,0])this object, then projection....

When i draw the polygon, the following is generated. Have a look, that doesnt look like a thread...

well...I used Boolean to intercept a very thin section, which is also your result, so I thought of the method of projection, but...

Its a broken file i think. Where did you get it from?

From MCAD, but i rewrite it with solidpython, then convert to this testc.scad.

"floating" type ???

ok sounds complex :)
No idea what went wrong.

i know...floating point error! but how to mitigate???

Comments deleted.