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 - matthest

Pages: [1]
1
General Discussion / Re: Planned new features in AngelCAD
« on: 2021-01-13, 17:30:04 »
2) how can I call this update from command line (CMD windows) ?

3) I have not read much about STL, but this link mentions something about colors: https://en.wikipedia.org/wiki/STL_(file_format)

2
Hi Carsten. I have made the object in angelcad instead of using the .OFF file.

If it is interesting for error-debugging. you may have a look at the .off file attached.


3
General Discussion / Re: Planned new features in AngelCAD
« on: 2021-01-13, 15:07:58 »
Hi Carsten, first, thanks for your effort, truly great way of working with 3D modelling!
After playing around a bit I have some general comments to Angelcad V1.5-06 running on Windows 10.

1) after each save/F6 the editor jumps to the top. Thus I have to scroll down to my code (e.g line 245 again after every rerun at the code).
2) Angelviewer update command is hidden (but pressing F6 automatically updates Angelviewer). Perhaps show how this is done in the console?

3) It would be truly interesting to add colors or somehow differentiate between parts in the code.


4
I downloaded the STEP from this website https://www.newhavendisplay.com/nhd70800480ftcsxvctp-p-9577.html
Converted to .OFF using freecad then imported to angelcad.

solid@ display_no_FPC()
{
    tmatrix@ DISP_OFFSET = translate(0,-200,0);
    tmatrix@ face_out = rotate_x(deg:90);
   
    solid@ s =  Enc().toEdgeTop()*Enc().toCenterZ()*DISP_OFFSET * face_out
                 *(polyhedron("C:/Users/mattis/Documents/OpenSCADLIB/VS/Display - NHD-7.0-800480FT-CSXV-CTP.off"));
   
    return s;
}
void main()
{

   shape@ obj = enclosure() + display_no_FPC();

   obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.005);
}


I get the error
xcsg finished with exception: (carve error): D:\cpde_3rdparty\msvclibs\carve\lib
If i change the line:
tmatrix@ DISP_OFFSET = translate(0,-200,0); =>     tmatrix@ DISP_OFFSET = translate(0,-100,0);
then the error disappears. Any idea what the problem is?

5
Hi Carsten. the result is not going to look like this, but it is interesting for an analysis I have in modeling of an optical cable.
Optical cables have loss when being bent to much and I will use this to find best case e.g bend radius on optical cables.

I have time to wait, and I think the answer you come up with would be very interesting for other solids, as well as for debugging issues later.
Thanks for your effort

6
General Discussion / Color changes in Anglecad
« on: 2020-06-07, 16:20:05 »
Hi.
I am wondering, is it possible to change the colors on AngelView, e.g White edges on blue background?
Can I change it without compiling a new version of AngelView?

7
Hi. Wondering if there is some sort of best practice for adding several solids on top of each other.

I have an example with three solids made out of sinusoidal functions called circle_bottom(), circle_middle(), and circle_top().
Having added them in a sum "return circle_bottom()+ circle_top()" works, but "return circle_bottom()+ circle_top() + circle_middle();" removes the first two solids.

I get some warnings etc, but I am nut sure how to debug:
Code: [Select]
Warning: Polyhedron is not water-tight, it has 8 edges, 8 with wrong use count, 8 with use-count==1
https://imgur.com/LPWtILJ
https://imgur.com/X36oa4V

Code: [Select]
// AngelCAD sample: vase_with_handle.as
// This example demonstrates use of sweep
#include "circlemaker.h"



shape@ main_shape()
{
   // scale down for web visualisation
   return circle_bottom()+ circle_top() + circle_middle();
}

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


Code: [Select]
solid@ circle_middle()
{
   
   shape2d@ prof = circle(r:2);
   pos3d@[] p;
   vec3d@[] v;
   double dt = 10.0;
   double ds = 2*PI/40;
   double alpha = 0;
   
   double x_; // new x value after movement
   double z_; // new z value after movement
   
   for(uint i=0; i<21; i++) {
      double x= 40*sin(i*ds);
      double y = 40*cos(i*ds);
      double z = 40*(-cos(2*PI*x/(40*4)));
     
      double hypotenus =x;
      if(x != 0){
         alpha = atan(z/x);
         print("x="+x);
         print("\n");
         print("z="+z);
         print("\n");
         x_ = hypotenus*cos(alpha);
         z_ = hypotenus*sin(alpha);
         print("x' = "+x_);
         print("\n");
         print("z' = "+z_);
         print("\n");
         print("alpha="+alpha/(2*PI)*360+" degrees");
         print("\n\r");

      }
      else{
         alpha = 0;
         print("x="+x);
         print("\n");
         print("z="+z);
         print("\n");
         x_ = hypotenus*cos(alpha);
         z_ = hypotenus*sin(alpha);
         print("x' = "+x_);
         print("\n");
         print("z' = "+z_);
         print("\n");
         print("alpha="+alpha/(2*PI)*360+" degrees");
         print("\n\r");
      }
     
     
      p.push_back(
         pos3d(x_, y, z_)
         ); // straight line
      v.push_back(vec3d(1,0,0));   // sine curve radius
   }

   spline_path@ path = spline_path(p,v);
   return sweep(prof,path);
}

solid@ circle_top()
{
   
   shape2d@ prof = circle(r:2);
   pos3d@[] p;
   vec3d@[] v;
   double dt = 10.0;
   double ds = 2*PI/40;
   double alpha = 0;
   double x_; // new x value after movement
   double z_; // new z value after movement
   
   for(uint i=0; i<21; i++) {
      double x= 40*sin(i*ds);

      double y = 40*cos(i*ds);
      double z = 40+40*(-cos(2*PI*x/(40*4)));
      double hypotenus =x;
      if(x != 0){
         alpha = atan(z/x);
         print("x="+x);
         print("\n");
         print("z="+z);
         print("\n");
         x_ = hypotenus*cos(alpha);
         z_ = hypotenus*sin(alpha);
         print("x' = "+x_);
         print("\n");
         print("z' = "+z_);
         print("\n");
         print("alpha="+alpha/(2*PI)*360+" degrees");
         print("\n\r");

      }
      else{
         alpha = 0;
         print("x="+x);
         print("\n");
         print("z="+z);
         print("\n");
         x_ = hypotenus*cos(alpha);
         z_ = hypotenus*sin(alpha);
         print("x' = "+x_);
         print("\n");
         print("z' = "+z_);
         print("\n");
         print("alpha="+alpha/(2*PI)*360+" degrees");
         print("\n\r");
      }
     
     
      p.push_back(
         pos3d(x_, y, z_)
         ); // straight line
      v.push_back(vec3d(1,0,0));   // sine curve radius
   }

   spline_path@ path = spline_path(p,v);
   return sweep(prof,path);
}


solid@ circle_bottom()
{
   shape2d@ prof = circle(r:2);
   pos3d@[] p;
   vec3d@[] v;
   double dt = 10.0;
   double ds = 2*PI/40;
   
   for(uint i=0; i<21; i++) {
      p.push_back(pos3d(40*sin(i*ds),40*cos(i*ds),0)); // straight line
      v.push_back(vec3d(1,0,0));   // sine curve radius
   }

   spline_path@ path = spline_path(p,v);
   return sweep(prof,path);
}

Pages: [1]