Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - raymw

Pages: 1 [2] 3
16
General Discussion / Re: console mesages
« on: 2020-09-09, 00:34:16 »
I thought i had completed the handwheel project of mine. It produces an stl file that renders well in meshlab, but Cura, Slic3er and IceSlicer can not slice it properly- they each give different but wrong results. The saga continues..

17
General Discussion / Re: console mesages
« on: 2020-09-08, 20:55:18 »
I scrapped what i was doing, or at least the way i was trying to do it, and came up with this (part of a generic wheel creator I am thinking about). It produces rounded ends on tubes, and can be extended for straight slabs, too. The secret is in the polygon shape. The one shape allows inside and outside ends of a tube to be rounded. It seems quite robust, for once, for me. Instead of the polygon, then a square at 45deg, would chamfer the ends. Obvious limits in the relationship between the fillet diameter and inside diameter of the tube using this
Code: [Select]
/ AngelCAD code.

//
// rounds tube ends


double rimod=50;// rim od
double rimid=8;//rim id
double rimthick=48;// rim thickness
double round =10;// diameter of fillet

solid@ rim( double h, double od,double id)
 {
    return cylinder (h,od/2)-cylinder(h,id/2);
   
  }

 shape2d@ corner_poly(double filletdiam,double bigdiameter)
 {  // generates polygon for rounding corners
     double  r= filletdiam/2;
     double br= bigdiameter/2;
     shape2d@  block = square(2*r);
     @block = block - translate(0,2*r)*circle(r);
     @block = block - translate(0,0)*circle(r);
     @block = block - translate(2*r,0)*circle(r);
     @block = block - translate(2*r,2*r)*circle(r);
     return translate(br,0)*translate(-r,-r)*block;
     return block;
 }
 
 
 solid@ round_over(double filletdiam, double circlediam)
 {
    shape2d@ poly = corner_poly(filletdiam,circlediam);
    solid@ curv = rotate_extrude(poly,360,0);
    @curv = rotate_x(90)*translate(0,filletdiam,0)*curv ;
    return translate(0,0,-filletdiam)*curv;
 }
 
 
shape@ main_shape()
{
  solid@ os = rim(rimthick,rimod,rimid);
 @os = os - round_over(round,rimod); //bottom outside
 @os = os - translate(0,0,rimthick)*round_over(round,rimod); //top outside
 @os = os - round_over(round,rimid); //bottom inside
 @os = os - translate(0,0,rimthick)*round_over(round,rimid); //top inside
 return os;

}

void main()
{
   shape@ obj = main_shape();
   obj.write_xcsg(GetInputFullPath(),secant_tolerance:.001);
}

18
General Discussion / console mesages
« on: 2020-09-08, 15:59:24 »
Hi,
Trying to tune up some code, making it more succint, to put in my library, and I find that it often does not complete execution. It seems often to struggle with tori. Below is the typical console message I get.
Code: [Select]
1796 > "C:\Program Files\AngelCAD\xcsg.exe" --csg --dxf --stl --svg --fullpath "C:\Users\Ray\Desktop\AngelCad\xcsg\handwheel2.xcsg"
xcsg processing: C:/Users/Ray/Desktop/AngelCad/xcsg/handwheel2.xcsg
processing solid: difference3d
...completed CSG tree: 21 boolean operations to process.
...starting boolean operations
...boolean progress: 9.5%
...boolean progress: 19%
...Info: rotate_extrude angle>=2*PI implies a torus
...boolean progress: 28.5%
...boolean progress: 38%
...boolean progress: 47.6%
...Info: rotate_extrude angle>=2*PI implies a torus
...boolean progress: 57.1%
...boolean progress: 66.6%
...Info: rotate_extrude angle>=2*PI implies a torus


playing with some values, or adjusting secant_tolerance may allow it to complete, but more often it stalls somewhere else. Is it possible to give more detail in the console messages, as to where in the script it may be failing? I comment out sections, etc., to try and find the error, but when perhaps I have a function that works most of the time, but sometimes when it is called, it stops, is it the function in error, or the calling that is the cause of failure? Alter the function, chances are it will not work where once it worked before.

edit, adjusted secant tolerance, and got this, as last two lines.
Code: [Select]
...Info: rotate_extrude angle>=2*PI implies a torus
xcsg finished with exception: (carve error): D:\cpde_dep\3rdparty\carve\lib\intersect_face_division.cpp:587  "implement me"

which most likely is a clue.

19
Thanks Carsten, I was neglecting the @mycub, and the error message I as getting, was not understanding what I was trying to do, but what it thought I was trying to do. So far, I've only played in a very small corner of AngelCad, my approach mainly being to replicate how i would physically make the objects, and I could no understand why I could not continually alter one object, but had to use intermediaries.

20
I'm wondering if the syntax for the user could be 'improved'. afaik, if I want to create an object with a number of alterations to it, say to represent a plate with a pattern of holes in it, I have to either make multiple objects, either adding them up as I proceed, or at the end, in a return statement, say. The alternative is to create an array, and add the holes there, which seems artificial, to me. Is there not a simpler construction that could be implemented, as in my commented code below, sort of incrementing an object in the similar way we handle other values?


Code: [Select]
// AngelCAD code.

shape@ main_shape()
{
   // create cube and 3 small cubes
   double d = 100;
   solid@ mycub = cube(d);
   solid@ hole = cube(2);
   solid@ holecube1 = mycub - translate(5,10,d-2)*hole;
   solid@ holecube2 = holecube1 -translate(90,5,d-2)*hole;
   solid@ holecube = holecube2 -translate(50,50,d-2)*hole;
 
   return holecube;
}

/*
shape@ main_shape()
{
   // create cube & 3 small cubes - the way I'd like it
   double d = 100;
   solid@ mycub = cube(d);
   solid@ hole = cube(2);
   solid@ holecube = mycub - translate(5,10,d-2)*hole;
   holecube =- translate(90,5,d-2)*hole;
   holecube =- holecube2 -translate(50,50,d-2)*hole;
 
   return holecube;
}

*/
void main()
{
   shape@ obj = main_shape();
   obj.write_xcsg(GetInputFullPath(),secant_tolerance:-1.0);
}

21
General Discussion / Re: rendering of imsges
« on: 2020-09-07, 00:03:31 »
Thanks, I have done that since my first post, but how much longer does it have to be? I suppose the answer is 'long enough'. It could be a problem that the 'long 'hole' could enter a part of the object that you needed it to avoid. It is odd that one hole looks OK, and not the other. In my latest, more complex item, I found it to be very sensitive, overall, in setting the secant_tolerance value. I found if the value was set to give smooth curves, then other parts just disappeared, or generally got messed up.

Anyway, for many parts, it doesn't matter if cylinders are faceted. This very generic handwheel has turned out good enough.

22
General Discussion / Re: rendering of imsges
« on: 2020-09-06, 20:48:11 »
There seems to be a general problem, with cross holes  passing through tubes. depending on the secant_tolerance:value, you do not get the hole, or get a red spot, or if you get the hole, then the tubes are not having a smooth round surface, but a polygon with about ten sides, or the object 'breaks' in other ways. if instead of subtracting, you add, you then get the rod showing correctly. If the edges are viewed, it sort of looks as if the hole is spread over the surface of the cylinder.

23

If we take a simple example to start with, the coupler, (the rendering of which I queried a few days ago),

Code: [Select]

// AngelCAD code.

shape@ main_shape()
{
   // create cube & sphere in default positions
   solid@ tube = cylinder(30,10);
   solid@ shank = cylinder(10,7.5);
   solid@ shaft = cylinder(30,4);
   solid@ fix = rotate_y(90)*cylinder(50,1);
//drill the two fixing holes straight through tube
   return tube-shank-shaft - translate(-20,0,4)*fix -translate(-20,0,22)*fix;
}

void main()
{
   shape@ obj = main_shape();
   obj.write_xcsg(GetInputFullPath(),secant_tolerance:.005);
}

 (you can tell I never removed all the 'new' Angelcad comments!)

from a machining point of view, a sort of p-code could be

profile circle, 30 deep, 20 diameter
bore in centre, 10 deep, 15 diameter
bore in centre, 30 deep, 8 diameter
rotate cylinder 90 degrees on  y axis
bore on centre line, 4  from end
bore on centre line, 22 from end

For many situations, machining consists of repeating standard procedures in different locations, orientation of work piece, and using different tools.

The above p-code could be readily translated into AngelCad script, and a library of functions could be developed. Knowing the size of the tool, and material type, etc., then the same p-code could generate the G-code too.

Instead of saving the AngelCad file, and  a separate g-code file, the g-code could be embedded as comments in the AngelCad file  e.g. all g-code comments begin with '//>> G01 x20.000 -y67.8765'  and then that can be run through a process that extracts all lines beginning with' //>>' and removes the '//>>' giving the g-code that you need. The actual method is unimportant, but with a consistent, well thought out structure that would possibly allow quick visualization via AngelCad, and produce the G-code file, too.

To start with, to see how extensible it can be, then I think I would standardize on a single sized tool, and a soft material. The machining would have to be limited to the movements available, e.g. rotate on y axis won't work on a usual 3 axis machine, unless manual intervention is employed. (but you'd have to do that anyway.) In such cases, issue a pause, and comment in the instruction within the g-code.



                                 

24
General Discussion / rendering of imsges
« on: 2020-09-03, 15:53:38 »
One thing I like with AngelCad, is the speed of developing functional mechanical devices, in a sequential manner, where they do not need to look 'pretty', although it is fairly easy to round edges, etc. I needed a coupler, to extend a hand-wheel shaft, and in a few minutes, I got this -
Code: [Select]
// AngelCAD code.

shape@ main_shape()
{
   // create cube & sphere in default positions
   solid@ tube = cylinder(30,10);
   solid@ shank = cylinder(10,7.5);
   solid@ shaft = cylinder(30,4);
   solid@ fix = rotate_y(90)*cylinder(50,1);
//drill the two fixing holes straight through tube
   return tube-shank-shaft - translate(-20,0,4)*fix -translate(-20,0,22)*fix;
}

void main()
{
   shape@ obj = main_shape();
   obj.write_xcsg(GetInputFullPath(),secant_tolerance:.005);
}

However, when viewing this, at most orientations, the fixing cross hole through the small bored end, looks wrong. At first view, I thought for some reason, I had not made it long enough, or it was offset too far. Just wondering if the lighting? could be improved.

edit to add, meshlab does not show that fix-hole at the surface, no matter how it is orientated, but Cura reports a fault - object not manifold, but it looks as it should, apart from highlighting at the hole surface, but it seems to slice OK, printing it now. So, I'm guessing it's within the mesh, not the lighting.

25
Having looked at a couple of simple shapes in csg format, that almost looks like G-code, but then G-code is more or less points in space. A square pocket is easier. If you need to know if a point is inside a boundary, then simply draw a line in any direction from the point, and if it crosses a boundary an odd number of times, it is outside, or an even number it is inside. You have to define how to handle the situation of a point being on a boundary. If it is a case of being happy with creating the cad by scripting, then perhaps it is simplest to generate a scripting language with inherent machine commands, so that as you draw the shape, it also writes the g-code. However many machine controllers, Fanuc, Seimens, Prototrac, (sp?) etc, more or less do that. The tool size and material requirements I would set initially, then after the principle was proved, add features as required. If you look at the resources that autodesk, for example, throw at their software, then in reality, you are unlikely to get near them, but no harm in trying, and as AngelCad, or openscad allows quick drawings of a certain type to be produced, then with restrictions, producing g-code at the same time should be possible. However if nobody else thinks it is worthwhile, then you'll have to learn coding yourself, openscad, and Angelcad are both opensource, and you are allowed to add/adjust/whatever, according to their agreements.

26
General Discussion / Re: a simple clip
« on: 2020-08-29, 12:42:34 »
Thanks. I'll use that for the next batch I print. I can't see the difference in sizes in my original version, but can see the angle in the join. Not sure if the slicer picks out the change in diameter between end and coil, or if it does if the extruder can.

27
General Discussion / a simple clip
« on: 2020-08-29, 00:23:47 »
You can buy similar items for pennies, but if the shops are shut...

Having got a bit fed up with cutting/replacing cable ties, i thought of an alternative, similar to items I'd seen in garden centres for clipping plants to supports. As I have a 3d printer with nothing to do, i used AngelCad to make a similar clip, and thought that I could print it at different sizes, for holding different things, and if I used Pet-G filament, it would withstand the greenhouse temperatures, and unlike PLA, would be unlikely to bio-degrade.
So, here's some script with comments -

Code: [Select]
// AngelCAD code.

// Based on AngelCAD sample: screw_threads.as
// demonstrate use of rotate_extrude with non-zero pitch to create screw threads.

double wirediam = 3;
double gripdiam = 8; // inside diameter of coil.


//**************************
double ol = wirediam/10 ; // overlap
double gripr = (gripdiam +wirediam)/2;
double wirer = wirediam/2;
double len = gripr + wirer;

solid@ end()   // straight end with knob
{
  // generate ends
  solid@ end = cylinder (len,wirer/0.99);  // fudged the diameter of end
  solid@ ball= sphere(wirediam/1.2);
  return end+translate(0,0,len)*ball;
}

solid@ coil()
{
   // comments from screw_threads.as example
   // create a polygon from the points,
   // and position the resulting profile on the positive x-axis
   // shape2d@ poly = translate(gripr,0)*rotate_z(deg:-90)*circle(wirer);
 
   shape2d@ poly = translate(gripr,0)*circle(wirer);

   // perform 1 full rotations, with s small pitch to offset the threads
return rotate_extrude(poly,deg:360*1,pitch:wirediam*1.1);  //single turn coil
}

shape@ all() // put the ends onto the coil
{
  solid@ end1= translate(gripr,0,ol)*rotate_y(180)*end();
  solid@ end2= translate(gripr,wirediam*1.1,-ol)*end();
return end1 + end2  + coil();
}

void main()
{
   shape@ obj = all();
   obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.01);
}

I ran into a problem, because the ends of the coil are not cut on the x/y plane, which presents an angle to the two end pieces. I added an overlap to remove the gap, but found that It would not complete for wire diameters over 2.0, or so. I fudged it again, by making the end pieces slightly larger. This works, but it is not particularly elegant. It would be better to generate  a path from end to end, and extrude along that. However, these loops are now holding up my tomato plants, and smaller ones will be used as cable clips on the printer as originally intended. They print OK, lying flat, with a few supports.

edit to add a couple of quick pics

28
Using AngelCAD / Re: AngelCAD on Thingiverse
« on: 2020-08-28, 23:31:36 »
Another search engine - Yeggi.com -  picks up 3d models from sites other than thingiverse. a search for AngelCad gives seven results, all for thingiverse, however. Not sure what you need to do to get Angelcad listed as a design tool on Thingiverse, because there are in fact about 21 models for Angelcad there.

29
Thanks - by default, I have scripting turned off in Firefox, I didn't see the tags. I'll try and remember in future.

30
Many milling tools are used in more than one way. A square ended mill, for example, is used for milling something flat, and the sides of said cutter for milling profiles., or all at once for making slots. That is not a compromise, it is using the tool as intended. If you are out on a limb, then perhaps you have  to design your own tool. All tools originated by someone solving a problem.

Unfortunately, Everything in engineering, and life in general, is a compromise, you've got to find the ones you're happy with, and work from there. I believe you are suffering from 'the not invented here syndrome', nothing being any use unless you've invented it, it fits exactly into your mind set. If the tool does not do what you want, then why mess around with the carbide3d? Get yourself some proper joinery machinery. If I wanted to make decent jointed boxes, that is possibly the compromise I would make, balancing time against cash and workshop space, whatever.

If you're accepting the compromise of shallow depth 3 axis machining, then the only way you can cut any surface, and undercut, on five sides at one hit is with a ball ended milling cutter (not a bull nosed but something like this http://cnc-plus.de/images/product_images/info_images/2974_2.jpg and then you live with a smoothish finish, but no sharp edges.to the bottom of any recesses. If you want undercutting then use a T slot cutter, or a dovetail cutter, or similar, but that is accepting the compromise that it will only give straight smooth edges, but at restricted angles. If you want square edges and corners, then the morticer is the tool to use. All the above  is accepting the compromise of not refixing the workpiece in some other orientation, or changing the tooling part way through the job.

It doesn't matter what fancy g-code/cad/cam/machine you use, at the end, it depends on the tool profile, its strength, etc. I'm not convinced you have specified what it is you are trying to achieve in enough detail for me to be able to offer much practical advice, except before getting bogged down in AngelCad/Openscad/whatever theory, I would suggest you get some bits of wood, and drive the router manually, to see if you can actually get the fit you want with the tooling that you have.

Why not start with something simple, let's say milling a 20mm cube? I guess your carbide3d machine can handle that. Making it from a 20mm thick piece of timber, clamped well out of the way of the area you are working on. What do you want to happen? Draw a 20mm cube in AngelCad, then generate the G-code somehow from that? Or, are you going to draw a 30mm cuboid, 20mm high, and let the 10mm cutter follow the path in the xy plain, and hope it can cope with a single 20mm depth of cut, or somehow 'it' will know that 20mm in z means 5 passes, say? Neither of these approaches is a Cad problem, it's not difficult to draw either size of cube/oid. OK, having decided that, how do you cope with a 20mm square hole (forget about the rounded corners), pocketing, say 10mm deep? Do you draw a cube 20mm square, knowing that the cutter has a square end - how is that be communicated between the cad and machine- or do you draw it as a 20mm cuboid, again 10mm deep, and communicate that it must cut on the inside of the line.

Many types of cnc machines rely on colour of line to define depth, laser cutters, switching from cut power to etching. There are plenty of cnc sort of raster programs, that can take a greyscale image, and machine to different depths depending on the shade of grey. Maybe, you could manually shade your pocketed regions - but that would not be automatic, unless you added some extra code to AngelCad, but you'd have to get used to the (void main int thing), and I feel your pain there XD

(one day, I'll write a short, non confrontational post.)

Pages: 1 [2] 3