Recent Posts

Pages: [1] 2 3 ... 10
1
Using AngelCAD / Re: Run OpenSCAD .scad scripts with AngelCAD V1.5
« Last post by raymw on 2021-05-06, 20:57:11 »
exactly as posted (without the fillet operational) it takes 1 minute and 27 seconds in openscad on my machine, and in angelcad, it produces a couple of lines -  UNEXPECTED face loop with size != 1.
UNEXPECTED face loop with size != 1. (and other messages as well), and a broken model. This is what I was getting at, what runs in openscad slowly, may not run at all in angelcad. I initially ran it in angelcad, with the fillet, since that took far to long in openscad. It did not run properly in angel cad, so I commented out the fillet code, and it still did not run in angel cad. I've just run this commented code, exactly as shown in the forum, and on my pc it takes 1 minute and 27 seconds in openscad. Your machine must be a bit faster, but it still does not run in Angel cad. It would be nice to know what causes the unexpected face loop, but I eventually got a result in openscad that was good enough. 
2
Thanks, there might still be an issue with attachments on the forum, sorry about that. Will see if it can be fixed.

However: When running the code you posted 2021-05-06, 00:13:53 unchanged, it now completes (F6) in less than a second in OpenSCAD, so this example is not reflecting the problem you described.

If you want me to look at this general issue further, please find a suitable example, test it and post the code exactly as tested in a new thread (do not continue this thread). I don't have time to guess at what you may or may not have done and I can't reproduce the problem.

3
Using AngelCAD / Re: Run OpenSCAD .scad scripts with AngelCAD V1.5
« Last post by raymw on 2021-05-06, 17:34:56 »
The threading stuff is in  NopSCADlib and comes from https://github.com/nophead/NopSCADlib as you said.
The fillet was found on https://www.thingiverse.com/thing:2461392  there is a slight error in the code, I corrected it and reported it to the author, not sure if he fixed it, (I've attached that file*, but you can comment that out in my example). The problem is, that If I can't get things to work, then I try another way, and tend to forget the details of the original problem, which is probably not much help to you.

* for some reason, it couldn't get the path to the zip file for the attachment, so it's all below

Code: [Select]



/*
Created by Kevin Gravier
https://www.thingiverse.com/mrkmg/about

My take on a top and bottom fillet for a 3d shape.

Available Modules:

topBottomFillet(b, t, r, s, e)
b = z of bottom of 3d object
t = z of top of 3d object
r = radius of fillet
s = steps of filler (smaller is smoother)
e = enabled (pass e = 0 to disable fillet for faster preview)

topFillet(t, r, s, e)
t = z of top of 3d object
r = radius of fillet
s = steps of filler (smaller is smoother)
e = enabled (pass e = 0 to disable fillet for faster preview)

bottomFillet(b, r, s, e)
b = z of bottom of 3d object
r = radius of fillet
s = steps of filler (smaller is smoother)
e = enabled (pass e = 0 to disable fillet for faster preview)

*/

enable = 1;
/*
// Example, hard edges
translate([0, 20, 0])
topBottomFillet(b = 0, t = 10, r = 2, s = 20, e = enable)
linear_extrude(10, scale = 1.2)
difference() {
    union() {
        square([10, 10], true);
        translate([-15, 0]) circle(15);
    }
    translate([-15, 0]) circle(8);
    translate([-15, 0]) square([13, 13], center = true);
}

// Example, soft edges
use <fillets2d.scad>;
translate([0, -20, 0])
topBottomFillet(b = 0, t = 10, r = 1, s = 10, e = enable)
linear_extrude(10)
rounding2d(1)
fillet2d(1)
difference() {
    union() {
        square([10, 10], true);
        translate([-15, 0]) circle(15);
    }
    translate([-15, 0]) circle(8);
    translate([-15, 0]) square([13, 13], center = true);
}


// Example, text
translate([-60, 40])
rotate([0, 0, -90])
topBottomFillet(b = 0, t = 3, r = .5, s = 5, e = enable)
linear_extrude(3)
text("Fillets!", size = 20);

*/
// Library

function filletDepth(r, d, i) = r * cos(asin(d * i / r));

module topBottomFillet(b = 0, t = 2, r = 1, s = 4, e = 1) {
    if (e == 1) {       
        topFilletPeice(t = t, r = r, s = s) children(0);
        bottomFilletPeice(b = b, r = r, s = s) children(0);
       
        render()
        difference() {
            children(0);
           
            translate([0, 0, t - r])
            linear_extrude(r + 1)
            offset(delta = 1e5)
            projection()
            children(0);
           
            translate([0, 0, b - 1])
            linear_extrude(r + 1)
            offset(delta = 1e5)
            projection()
            children(0);
           
        }
    }
    if (e == 0) children(0);
}

module topFillet(t = 2, r = 1, s = 4, e = 1) {
    if (e == 1) {
        topFilletPeice(t = t, r = r, s = s) children(0);
       
        render()
        difference() {
            children(0);
            translate([0, 0, t-r])
            linear_extrude(r + 1)
            offset(delta = 1e5)
            projection()
            children(0);
        }
    }
    if (e == 0) children(0);
}

module bottomFillet(b = 0, r = 1, s = 4, e = 1) {
    if (e == 1) {
        bottomFilletPeice(b = b, r = r, s = s) children(0);
       
        render()
        difference() {
            children(0);
            translate([0, 0, b -  1])
            linear_extrude(r + 1)
            offset(delta = 1e5)
            projection()
            children(0);
        }
    }
    if (e == 0) children(0);
}

module topFilletPeice(t = 2, r = 1, s = 4) {
    d = r/s;
       
    for (i = [0:s]) {
        x = filletDepth(r, d, i);
        z = d * (s - i + 1);                 
        translate([0, 0, t - z])
        linear_extrude(d)
        offset(delta = -r + x)
        projection(true)
        translate([0, 0, -t + z])
        children(0);
    }
}

module bottomFilletPeice(b = 0, r =1, s = 4) {
    d = r/s;
       
    for (i = [0:s]) {
        x = filletDepth(r, d, i);
        z = d * (s - i);
        translate([0, 0, b + z])
        linear_extrude(d)
        offset(delta = -r + x)
        projection(true)
        translate([0, 0, b - z])
        children(0);
    }
}
4
I can't promise much, but I could at least try to reproduce your observations and see what that leads to, if anything. To do that I need to know where to find your 2 .scad includes

I am guessing NopSCADlib comes from https://github.com/nophead/NopSCADlib , please confirm

But where is include<rw/fillets3d.scad> to be found? If it is just a local file you have, please put it in a zip file and attach it to a reply.

--
I can't promise much, but I could at least try to reproduce your observations and see what that leads to, if anything. To do that I need to know where to find your 2 .scad includes

I am guessing NopSCADlib comes from https://github.com/nophead/NopSCADlib , please confirm

But where is include<rw/fillets3d.scad> to be found? If it is just a local file you have, please put it in a zip file and attach it to a reply.

EDIT: Your example as shown runs in 43 seconds using OpenSCAD nightly, with the filletting commented out. Please be exact wrt. what you are running to make it easier to reproduce
5
Using AngelCAD / Re: Run OpenSCAD .scad scripts with AngelCAD V1.5
« Last post by raymw on 2021-05-06, 00:13:53 »
This is not what i wanted to show, since it does not work in angel cad, but does very slowly in openscad, but I had to comment out the fillet, I gave up waiting. There are a number of near misses with curves. If you've not got nophead'  library, then even if you comment out the 'male_metric_thread' line, it still won't work in angelcad, but it did more or less yesterday, iirc, because I experimented with the secant_tolerance values, smoothing out the curves.

Code: [Select]
//twist nut 8mm blank
include<NopSCADlib/utils/thread.scad>
include<rw/fillets3d.scad>

//module male_metric_thread(d, pitch, length, center = true, top = -1, bot = -1, solid = true, colour = undef) { //! Create male thread with metric profile example for variable names


//bottomFillet(b=0,r=1.5,s=8,e=enable)
translate([0,0,10])
difference(){
    union(){
      translate ([0,0, 5])  sphere( 12);
  scale([1.5,1,1])translate ([0,0,-5])  rotate ([90,0,0]) cylinder(h=3,d=15,center=true);
  cylinder (h=20,d=16,center=true);
  //  translate([0,0,10])cylinder (h=3,d=13);
    }
male_metric_thread(8,1.25,21);
 translate([0,0,-2])rotate([0,6,0])cylinder (h=21,d=8.2,center=true);   
   
  translate([0,0,-60])  cube([100,100,100],true); //chop off bottom
   
   
}


$fn=80;
//topBottomFillet(b = 0, t = 10, r = 1, s = 10, e = enable)
6
Hi Ray,

Yes, it is supposed to run much faster, although we do not claim that all scripts will work, but most will work fine.

The question of $fn (OpenSCAD) and secant_tolerance (AngelCAD) is not directly straightforward to answer. $fn defines the number of straight segments in e.g. a circle, but it does not take the radius into account. secant_tolerance computes the number of segments using also the radius. So there is not a direct relation.

Overall, AngelCAD takes the position that it describes high level geometry and that the discretization is secondary, and therefore it ignores the $fa $fs and $fn values in OpenSCAD.

Maybe you have an example where this issue shows itself? I can understand that it can be a slight issue since the STL result will usually not be 100% identical, but then we are down to discretization. So maybe you can show a case where the difference is unacceptable?
7
Using AngelCAD / Re: Run OpenSCAD .scad scripts with AngelCAD V1.5
« Last post by raymw on 2021-05-04, 22:50:59 »
This runs considerably faster than rendering within openscad, seconds instead of many minutes in the few tests I've done. Would it be possible to parse the openscad script, and extract the $fn=80; (or similar values) and prefill the 'args' with a suitable value for secant_tolerance?
8
Announcements / Forum configuration issues solved
« Last post by Carsten Arnholm on 2021-04-17, 18:32:20 »
Unfortunately, the forum has been inaccessible for a while due to server updates that caused a forum configuration problem.

This problem should now be resolved, so you may make posts again.

Regards, the forum moderators
9
General Discussion / Re: Planned new features in AngelCAD
« Last post by Carsten Arnholm on 2021-01-13, 20:44:46 »
2) I don't understand this question
You either open the file: angelview [<input_filename>]
or if it is already open it will be automatically reloaded

3) This is not standard in any way, and it is only theoretically possible in binary STLs. I don't think it is in use anywhere. There is no such option in the other formats.
10
The code is not complete. The function enclosure() is missing
Pages: [1] 2 3 ... 10