My utilities for OpenSCAD
gillesbouissac / agentscad Goto Github PK
View Code? Open in Web Editor NEWMy utilities for OpenSCAD
My utilities for OpenSCAD
My utilities for OpenSCAD
The following code (from the tutorials) sometimes does not render the threaded part of the bolts. The console shows a "mesh not closed" error:
use <agentscad/mx-screw.scad>
use <agentscad/mx-thread.scad>
// M6 bolt with 10mm thread length
$fn=50;
screw = M6();
mxBoltHexagonalThreaded(screw,10);
translate([50, 0, 0])
mxBoltAllenThreaded(screw,20);
screenshot of the render:
on the wiki for screws:
https://github.com/GillesBouissac/agentscad/wiki/Screws-shapes
these links are broken links:
Direct access to the code of the tutorial for each standard:
[Metric Coarse tutorial code](https://github.com/GillesBouissac/agentscad/blob/master/test/test-mx-screw-tutorial.scad)
[Metric Fine tutorial code](https://github.com/GillesBouissac/agentscad/blob/master/test/test-mxf-screw-tutorial.scad)
[UNC tutorial code](https://github.com/GillesBouissac/agentscad/blob/master/test/test-unc-screw-tutorial.scad)
[UNF tutorial code](https://github.com/GillesBouissac/agentscad/blob/master/test/test-unf-screw-tutorial.scad)
[BSW tutorial code](https://github.com/GillesBouissac/agentscad/blob/master/test/test-bsw-screw-tutorial.scad)
[BSF tutorial code](https://github.com/GillesBouissac/agentscad/blob/master/test/test-bsf-screw-tutorial.scad)
because these files are in a screws
subfolder:
https://github.com/GillesBouissac/agentscad/tree/master/test/screws
I would submit a PR for this, but it does not look like GitHub supports PRs for wiki. Please let me know if I can help with this.
with the following code:
use <agentscad/mx-screw.scad>
use <agentscad/mx-thread.scad>
$fn=50;
screw = M3(tl=2);
translate([0, 0, -.001])
mxBoltAllenThreaded(screw,10);
I am expecting to generate an M3 screw, which should have an external diameter of 3mm, but rendering shows a screw whose diameter is closer to 2*1.35mm (2.7mm):
is this a tolerance for printing?I would like to be able to adjust it because this is in fact too small to catch threads of metal nuts.
Good day, i am totally new to 3d printing and openscad! i would like to know how i use the files etc please? i am wanting to print some BSW threads to aid my rebuild on my old car.
many thanks
chris
...
Ah -- I see it is from hirthJointProfileRectangle()
Lines 118 to 125 in d146a7e
and
Lines 27 to 28 in d146a7e
as explained here:
...so setting $gap
would control the slop:
use <agentscad/hirth-joint.scad> // https://github.com/GillesBouissac/agentscad
MARGIN = 0.2;
$gap = 0.0;
module testHirthPair(){
difference() {
union() {
hirthJointRectangle( 5, 11, 1, 1, 1, shift=0.5 );
translate( [0,0,3+0.01] )
rotate([0,180,0])
hirthJointRectangle( 5, 11, 1, 1, 1, shift=0.5 );
}
cylinder(r=2.5,h=10, center=true);
}
}
testHirthPair();
When calling libNutHexagonal( p, false, false) or libBoltHexagonal( p, false, false) nut or bolt-head disappear.
My fix is:
module libBevelShape( l, d, a=BEVEL_HEXA_A, b=true, t=true ) {
h = (d/2)*tan(a);
r = (l+h)/tan(a);
intersection() {
if ( t ) {
translate([0,0,-l/2])
cylinder( r1=r, r2=0, h=(l+h) );
}
if ( b ) {
translate([0,0,-h-l/2])
cylinder( r1=0, r2=r, h=(l+h) );
}
//new
if ( (!t) && (!b) ) {
cylinder( r1=r, r2=r, h=l, center=true );
}
}
}
hey and thanks for sharing your awesome library.
It is not possible to use it though without having your specific local directory setup and other files referenced.
For example in this file:
agentscad/snap-joint.scad
There are several "use" calls to files that are not a git submodule and not part of this repository:
use <scad-utils/lists.scad>
use <scad-utils/transformations.scad>
use <agentscad/extensions.scad>
use <agentscad/printing.scad>
use <list-comprehension-dems/sweep.scad>
Cloning your scad-utils and moving some files to ./agentscad does help.
But the "sweep.scad" is calling in more files that I dont know where to find.
Could you provide the whole thing?
So that you can just clone / download in a new directory and it will run in openscad.
Test case:
use <agentscad/mx-screw.scad>
use <agentscad/mx-thread.scad>
$fn=36;
difference() {
union(){
mxBoltHexagonalThreaded(M5());
mxNutHexagonalThreaded(M5());
}
translate([0, 0, -5]) cube([10, 10, 20]); // x-section
}
I verified it's bolts by 3D-printing both bolt and nut in M3 size and trying to fit those with standard steel ones. Nuts are fine, bolts are not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.