Author Topic: rendering of imsges  (Read 176 times)

raymw

  • Newbie
  • *
  • Posts: 28
    • View Profile
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.
« Last Edit: 2020-09-03, 16:11:58 by raymw »

raymw

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: rendering of imsges
« Reply #1 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.

Carsten Arnholm

  • Administrator
  • Newbie
  • *****
  • Posts: 45
    • View Profile
Re: rendering of imsges
« Reply #2 on: 2020-09-06, 22:19:22 »
I recommend oversizing things you subtract, for example like 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(250,1,center:true);
//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);
}

raymw

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: rendering of imsges
« Reply #3 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.
« Last Edit: 2020-09-07, 00:26:53 by raymw »