# New site for "omdl" (A Mechanical Design Library) Classic List Threaded 9 messages Open this post in threaded view
|

## New site for "omdl" (A Mechanical Design Library) ...a collection of documented design primitives inspired by MCAD.It is now hosted on GitHub Pages Here. Be sure to browse the primitive functions, modules, and shapes in the library reference. Also, check out the Modules tab. The base primitives are validated when the documentation is built. The latest addition to the library is an additive edge generator for constructing moldings. Its still in it infancy, but taking shape... Thanks for looking!
Open this post in threaded view
|

## Re: New site for "omdl" (A Mechanical Design Library)

Added some tools for working with polygons...

## script:

```include <tools_polytope.scad>;

pc = reverse([[0,0], [10,0], [10,3], [3,3], [3,10], [0,10]]);
sc = [[1,1], [2,1], [2,2], [1,2]];
np = len(pc);
ns = len(sc);

cc =  [
for(i=pc) i,
for (j=[2,4,6]) for(i=translate_vp(sc,[0,j])) i,
for (j=[2,4,6]) for(i=translate_vp(sc,[j,0])) i
];

cp =  [
consts(np),
for (y=[0:5]) consts(ns)+consts(ns,np+ns*y)
];

c = rotate_vp(scale_vp(cc, 100), 30);
p = cp;

tp = [-50,200];

echo( faceverticies_hist=hist(polytope_faceverticies(p)) );
echo( edgelengths_hist=hist(sround(polytope_edgelengths(c, polytope_faces2edges(p)))) );
echo( edgeangles_hist=hist(sround(polytope_edgeangles(c, p))) );
echo( arefacesregular=polytope_arefacesregular(c, p) );
echo( arefacesregular=polytope_arefacesregular(c, [p]) );
echo( bbox_polygon=polygon2d_bbox_pp(c, p) );
echo( perimeter=polygon2d_perimeter(c, p) );
echo( area=polygon2d_area(c, p) );
echo( area=polygon2d_area(c, [p]) );
echo( centroid=polygon2d_centroid(c, p) );
echo( centroid=polygon2d_centroid(c, [p]) );
echo( is_cw=polygon2d_is_cw(c, p) );
echo( is_cw=polygon2d_is_cw(c, [p]) );
echo( is_convex=polygon2d_is_convex(c, p) );
echo( is_convex=polygon2d_is_convex(c, [p]) );
echo( is_pip=polygon2d_is_pip_wn(c, [p], tp) );

color("snow") polygon_bbox(c, p);
polygon(c, p);
translate(polygon2d_centroid(c, [p])) color("brown") circle(r=10);
translate(tp) color("red") circle(r=10);
polygon_number(c, p, tr=30);
```

## image output: ## console output:

```Compiling design (CSG Tree generation)...
ECHO: faceverticies_hist = [[6, 1], [4, 6]]
ECHO: edgelengths_hist = [[300, 2], [700, 2], [1000, 2], [100, 24]]
ECHO: edgeangles_hist = [[-90, 5], [90, 25]]
ECHO: arefacesregular = false
ECHO: arefacesregular = true
ECHO: bbox_polygon = [[[-500, 0], [-500, 1016.03], [866.025, 0], [866.025, 1016.03]], [[0, 1, 3, 2]]]
ECHO: perimeter = 6400
ECHO: area = 450000
ECHO: area = 510000
ECHO: centroid = [130.549, 487.216]
ECHO: centroid = [130.262, 486.144]
ECHO: is_cw = true
ECHO: is_cw = false
ECHO: is_convex = false
ECHO: is_convex = true
ECHO: is_pip = true
Compiling design (CSG Products generation)...
Geometries in cache: 33
Geometry cache size in bytes: 52144
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Compiling design (CSG Products normalization)...
Normalized CSG tree has 71 elements
Compile and preview finished.
Total rendering time: 0 hours, 0 minutes, 0 seconds
```

(currently in devel branch)...
RAS
Open this post in threaded view
|

## Re: New site for "omdl" (A Mechanical Design Library)

 In reply to this post by royasutton Over the past several weeks significant effort has gone into reorganizing the library. Please have a quick look at the latest version of omdl on Git Hub (currently v0.6). The full API can be browsed at the site. Thanks! Roy
Open this post in threaded view
|

## Re: New site for "omdl" (A Mechanical Design Library)

 This post has NOT been accepted by the mailing list yet. In reply to this post by royasutton Appreciate the great effort developing omdl. However, the following line failed to compile under Windows OpenSCAD + omdl v0.6.1 . cc =  [         for(i=pc) i,         for (j=[2,4,6]) for(i=translate_vp(sc,[0,j])) i,         for (j=[2,4,6]) for(i=translate_vp(sc,[j,0])) i       ]; i can compile only after cutting the last 2 for-loop lines and dropped the 6 squares. cc =  [         for(i=pc) i       ];
Open this post in threaded view
|

## Re: New site for "omdl" (A Mechanical Design Library)

 This post has NOT been accepted by the mailing list yet. This post was updated on . finally fixed compilation errors for latest v0.6.1, reporting to owner 1. diff between compilers in various platforms 2. much change after v0.5 math_utility.scad (fixed for Windows platform)     lstr     ([       for (i=[0:len(hv)-1])         lstr_html         (           [s1, first(hv[i]), s2, second(hv[i]), s3,  ((i<(len(hv)-1)) || fm) ? fs : empty_str],          b=fb, p=fp, a=fa, f=ff, d=d         )     ]); original     lstr     ([       for (i=[0:len(hv)-1])         lstr_html         (           [s1, first(hv[i]), s2, second(hv[i]), s3, if ((i<(len(hv)-1)) || fm) fs],          b=fb, p=fp, a=fa, f=ff, d=d         ),     ]);
Open this post in threaded view
|

## Re: New site for "omdl" (A Mechanical Design Library)

 In reply to this post by kwankung There were many name changes between the time of the above example and v0.6.1. I try to be responsible in the commit descriptions to warn of such changes. The commit logs can be reviewed at the development repository (here). For v0.6.1 the following should get you going. ```cc = [ for(i=pc) i, for (j=[2,4,6]) for(i=translate_lp(sc,[0,j])) i, for (j=[2,4,6]) for(i=translate_lp(sc,[j,0])) i ]; ```More Info: A distinction was made between vectors and lists. This change effects several functions and parameter names. A set of assumptions and conventions have been added to v0.6.1. They can be found in the "Related Pages" tab of the documentation under "Data types." Roy
Open this post in threaded view
|

## Re: New site for "omdl" (A Mechanical Design Library)

 In reply to this post by kwankung This is an important fundamental issue that you point out. The library needs to get clear about base OpenSCAD requirements/expectations. As identified, it currently makes use of a list comprehension feature that has been added to OpenSCAD. I am guessing this issue exists in other parts of the omdl library as well.Just out of curiosity as I work on an approach to address this issue, what version(s) of OpenSCAD are you using? Have you considered upgrading to a more recent release? Roy