Some wonderful tools in this library, truly.
BUT, how to I include them in my 'code?'
I wish to add small, strengthening fillets to my little BL Touch mount.
(No, haven't subtracted the notches/holes for the wires yet.)
So, where to the include statements go?
Thanks for the help!
David
Here's the code so far: (yeah, it's kinda ugly right now)
// Attempt at a BL Touch (BLT) mounting bracket that fits my CR-10 S5,
Ender 3 Pro, and Sunlu S8.
// Hope to do it all in variables. :)
$fn=30;
mbd = 4; // mounting bolt diameters
bltbd = 3; // mounting blt diameters
mbt = 4; // mounting base thickness
armt = 6; // arm thickness
arml = 30; // total arm length
armoffseth = 21.76; // from bottom of bracket. too low!
mountfw = 34.67; // mount full width
armoffsetl = 18; // arm offset left
mountfh = 37; // mount full height
mounttbhc = 4.19; // mount top bolt hole center, from right
mounttbhbr = 4.4; // mount top bolt hole center, from bottom
mountbbhcr = 22; // mount bottom bolt hole center, from right
mountbbbcb = 32; // mount bottom bolt hole center, from bottom
armbhacr = 23.38; // arm bolt holes (all) center, from right
// all arm bolt holes measured from base, and numbered from base
armbh1offset = 8.54; // arm bolt hole 1 center, from base
armbh2offset = 19; // arm bolt hole 2 center, from base
armbh3offset = 27.66; // arm bolt hole 3 center, from base
armtop = 9; // distanct from top of mount to top of arm
// full size base, arm, and total volume
difference () {
cube ([mountfh, mountfw, arml]); //full volume
cube ([28, armoffsetl, arml]); // subtract lower right block
translate([31.4, mounttbhc, 0]) // set location for bolt hole 1
cylinder(h=mountfh, d=bltbd); // subtract bolt hole 1
translate([13, 21.85, 0]) // set location for
bolt hole 2
cylinder(h=mountfh, d=bltbd); // subtract bolt hole 2
translate([0, armoffsetl, mbd]) // set location to remove
bottom left chunk
cube([22, 16.7, arml]); // subtract that chunk
translate([mountfh - armtop, 0, mbd]) // set location to remove
top chunk
// cube([mountfh - armtop, mountfw, mountfh]); // remove top
chunk
cube([mountfh - armtop, mountfw, mountfh]);
}
// translate([28.25, mountfw, mbd]); // set location
to remove top chunk
// cube([9, mountfw, mountfh]);
//translate ([40, 40, 0])
// cylinder(h=40, d=15);
The main files can be included with:
include <BOSL2/std.scad>
The docs are at:
https://github.com/revarbat/BOSL2/wiki/
-Revar
On Dec 12, 2020, at 12:36 AM, David ainut@hiwaay.net wrote:
Some wonderful tools in this library, truly.
BUT, how to I include them in my 'code?'
I wish to add small, strengthening fillets to my little BL Touch mount. (No, haven't subtracted the notches/holes for the wires yet.)
So, where to the include statements go?
Thanks for the help!
David
Here's the code so far: (yeah, it's kinda ugly right now)
// Attempt at a BL Touch (BLT) mounting bracket that fits my CR-10 S5, Ender 3 Pro, and Sunlu S8.
// Hope to do it all in variables. :)
$fn=30;
mbd = 4; // mounting bolt diameters
bltbd = 3; // mounting blt diameters
mbt = 4; // mounting base thickness
armt = 6; // arm thickness
arml = 30; // total arm length
armoffseth = 21.76; // from bottom of bracket. too low!
mountfw = 34.67; // mount full width
armoffsetl = 18; // arm offset left
mountfh = 37; // mount full height
mounttbhc = 4.19; // mount top bolt hole center, from right
mounttbhbr = 4.4; // mount top bolt hole center, from bottom
mountbbhcr = 22; // mount bottom bolt hole center, from right
mountbbbcb = 32; // mount bottom bolt hole center, from bottom
armbhacr = 23.38; // arm bolt holes (all) center, from right
// all arm bolt holes measured from base, and numbered from base
armbh1offset = 8.54; // arm bolt hole 1 center, from base
armbh2offset = 19; // arm bolt hole 2 center, from base
armbh3offset = 27.66; // arm bolt hole 3 center, from base
armtop = 9; // distanct from top of mount to top of arm
// full size base, arm, and total volume
difference () {
cube ([mountfh, mountfw, arml]); //full volume
cube ([28, armoffsetl, arml]); // subtract lower right block
translate([31.4, mounttbhc, 0]) // set location for bolt hole 1
cylinder(h=mountfh, d=bltbd); // subtract bolt hole 1
translate([13, 21.85, 0]) // set location for bolt hole 2
cylinder(h=mountfh, d=bltbd); // subtract bolt hole 2
translate([0, armoffsetl, mbd]) // set location to remove bottom left chunk
cube([22, 16.7, arml]); // subtract that chunk
translate([mountfh - armtop, 0, mbd]) // set location to remove top chunk
// cube([mountfh - armtop, mountfw, mountfh]); // remove top chunk
cube([mountfh - armtop, mountfw, mountfh]);
}
// translate([28.25, mountfw, mbd]); // set location to remove top chunk
// cube([9, mountfw, mountfh]);
//translate ([40, 40, 0])
// cylinder(h=40, d=15);
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I also wanted to try the BOSL2 library, so I downloaded it only to find that
it would not work with my old version of OpenSCAD. So I downloaded version
2019.05 and installed it on a Windows 7, 64 bit desktop computer. I
downloaded the BOSL2 ZIP file, "BOSL2-master.zip" and set up the BOSL2
folder per the instructions.
I tried tried three examples that I copied from the this forum and when I
try to preview any of the three examples I get the messages:
*Warning: Can't open include file 'BOSL2/std.scad'.
Warning: Can't open include file '../std.scad'.
Warning: Can't open include file '../hull.scad'.
Compiling design (CSG Tree generation)...
Warning: Ignoring unknown variable 'PHI', in
file../Users/Graphics/Documents/OpenSCAD/libraries/BOSL2/hull.scad,line7.
*The last warning is repeated about 12 times.
I do have the "include<BOSL2/std.scad>" statement in each example.
If I go to "File", "Show Library Folder", the BOSL2 file folder is shown and
all of the unzipped files are present.
What am I doing wrong?
Thanks
--
Sent from: http://forum.openscad.org/
It sounds like you did the right thing, so I'm a little bit unsure about
what's wrong.
If I try to run a BOSL2 example without it properly installed I get:
Parsing design (AST generation)...
WARNING: Can't open include file 'BOSL2/std.scad'.
WARNING: Can't open include file 'BOSL2/skin.scad'.
Compiling design (CSG Tree generation)...
WARNING: Ignoring unknown module 'path_sweep', in file test1.scad, line 13.
I do not get message about "../std.scad" for example. Those messages are
odd. What exactly is your code example?
Just to confirm, if you look in the library folder you see the BOSL2 folder
in there, and then inside the BOSL2 folder you have std.scad and the various
other BOSL2 scad files, so the file BOSL2/std.scad exists in the library
folder?
cbernhardt wrote
I also wanted to try the BOSL2 library, so I downloaded it only to find
that
it would not work with my old version of OpenSCAD. So I downloaded
version
2019.05 and installed it on a Windows 7, 64 bit desktop computer. I
downloaded the BOSL2 ZIP file, "BOSL2-master.zip" and set up the BOSL2
folder per the instructions.
I tried tried three examples that I copied from the this forum and when I
try to preview any of the three examples I get the messages:
*Warning: Can't open include file 'BOSL2/std.scad'.
Warning: Can't open include file '../std.scad'.
Warning: Can't open include file '../hull.scad'.
Compiling design (CSG Tree generation)...
Warning: Ignoring unknown variable 'PHI', in
file../Users/Graphics/Documents/OpenSCAD/libraries/BOSL2/hull.scad,line7.
*The last warning is repeated about 12 times.
I do have the "include<BOSL2/std.scad>" statement in each example.
If I go to "File", "Show Library Folder", the BOSL2 file folder is shown
and
all of the unzipped files are present.
What am I doing wrong?
Thanks
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@.openscad
--
Sent from: http://forum.openscad.org/
Yes. All the code examples and files are in the BOSL2 folder under My
Documents\OpenSCAD\Libraries
The code examples are the ones posted here:
http://forum.openscad.org/bending-a-shape-that-s-only-slightly-complex-td31059.html
The one posted by Renaldo I added the include statement.
The ones posted by Adrianv and thehans were not changed in any way.
I did have an old version of OpenSCAD installed on this computer and I
installed the new version in a different folder. Don't know if that would
cause my problem???
Perhaps I should uninstall everything and try again?
--
Sent from: http://forum.openscad.org/
You have the code examples in the Libraries folder, the same place where the
BOSL2 directory is located?
It looks to me like more than one thing is wrong. I don't think having
multiple OpenSCADs is an issue.
But you're getting errors that don't make sense, specifically the ones about
failure to find "../std.scad" and "../hull.scad". The only explanation I
can see for that is that your code is including BOSL2/tests/hull.scad, which
is strange, since the examples you list don't use hull.scad at all. I've
never noticed this issue, but it would be helpful if OpenSCAD gave the file
and line number of the include it can't find. That might give a clue about
what's going on.
It seems like the main issue is that somehow OpenSCAD is either not finding
the file, or is finding the wrong files. I don't know if there's any help
here:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries
If you put your example file in the same folder as the BOSL2 directory then
it should be guaranteed to work unless there's something wrong with the
BOSL2 folder itself.
I guess we can ask the question of what exactly the contents of the BOSL2
directory are. It should be this:
affine.scad
arrays.scad
attachments.scad
beziers.scad
bosl1compat.scad
bottlecaps.scad
changes/
common.scad
constants.scad
CONTRIBUTING.md
coords.scad
cubetruss.scad
debug.scad
distributors.scad
edges.scad
examples/
geometry.scad
githooks/
hingesnaps.scad
hull.scad
involute_gears.scad
joiners.scad
knurling.scad
LICENSE
linear_bearings.scad
masks.scad
math.scad
metric_screws.scad
mutators.scad
nema_steppers.scad
partitions.scad
paths.scad
phillips_drive.scad
polyhedra.scad
primitives.scad
quaternions.scad
queues.scad
README.md
regions.scad
rounding.scad
screws.scad
scripts/
shapes2d.scad
shapes.scad
skin.scad
sliders.scad
stacks.scad
std.scad
strings.scad
structs.scad
tests/
threading.scad
torx_drive.scad
transforms.scad
triangulation.scad
turtle3d.scad
tutorials/
vectors.scad
version.scad
vnf.scad
walls.scad
wiring.scad
WRITING_DOCS.md
Does that match what you have? What happens if you run a test "example"
that contains simply
include<BOSL2/std.scad>
and no actual code.
cbernhardt wrote
Yes. All the code examples and files are in the BOSL2 folder under My
Documents\OpenSCAD\Libraries
The code examples are the ones posted here:
http://forum.openscad.org/bending-a-shape-that-s-only-slightly-complex-td31059.html
The one posted by Renaldo I added the include statement.
The ones posted by Adrianv and thehans were not changed in any way.
I did have an old version of OpenSCAD installed on this computer and I
installed the new version in a different folder. Don't know if that would
cause my problem???
Perhaps I should uninstall everything and try again?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@.openscad
--
Sent from: http://forum.openscad.org/
adrianv wrote
But you're getting errors that don't make sense, specifically the ones
about
failure to find "../std.scad" and "../hull.scad". The only explanation I
can see for that is that your code is including BOSL2/tests/hull.scad,
which
is strange, since the examples you list don't use hull.scad at all. I've
never noticed this issue, but it would be helpful if OpenSCAD gave the
file
and line number of the include it can't find. That might give a clue
about
what's going on.
hull.scad is included by std.scad, but I don't know if it would try to open
it, or if so, if it would generate an error for an unknown variable.
But the thing I find strange is that two of the error messages seem to be in
conflict.
Warning: Can't open include file '../hull.scad'.
and
Warning: Ignoring unknown variable 'PHI', in
file../Users/Graphics/Documents/OpenSCAD/libraries/BOSL2/hull.scad,line7.
So I have to ask "was hull.scad found or not?".
--
Sent from: http://forum.openscad.org/
Another strangeness is that hull.scad has no references to PHI. There is only
one "phi" contained in a comment.
So.
It could not fine hull.scad
It found hull.scad
It found an error for a variable that was not usd in hull.scad.
--
Sent from: http://forum.openscad.org/
lar3ry wrote
adrianv wrote
But you're getting errors that don't make sense, specifically the ones
about
failure to find "../std.scad" and "../hull.scad". The only explanation
I
can see for that is that your code is including BOSL2/tests/hull.scad,
which
is strange, since the examples you list don't use hull.scad at all.
I've
never noticed this issue, but it would be helpful if OpenSCAD gave the
file
and line number of the include it can't find. That might give a clue
about
what's going on.
hull.scad is included by std.scad, but I don't know if it would try to
open
it, or if so, if it would generate an error for an unknown variable.
No, hull.scad is NOT included by std.scad.
But the thing I find strange is that two of the error messages seem to be
in
conflict.
Warning: Can't open include file '../hull.scad'.
and
Warning: Ignoring unknown variable 'PHI', in
file../Users/Graphics/Documents/OpenSCAD/libraries/BOSL2/hull.scad,line7.
So I have to ask "was hull.scad found or not?".
Actually you have drawn my attention to an important clue. The correct
hull.scad file does not reference PHI on line 7. The file which does is
tests/hull.scad. And tests/hull.scad does include ../hull.scad, so this
explains much of what's going on . It sounds like the directory structure
may have been collapsed when BOSL2 was unzipped. The BOSL2 directory
doesn't have the right files and folder structure in it.
I still don't understand why hull.scad was being referenced at all, though.
--
Sent from: http://forum.openscad.org/
adrianv wrote
No, hull.scad is NOT included by std.scad.
Right. I was just about to come here and correct my error.
Warning: Can't open include file '../hull.scad'.
and
Warning: Ignoring unknown variable 'PHI', in
file../Users/Graphics/Documents/OpenSCAD/libraries/BOSL2/hull.scad,line7.
So I have to ask "was hull.scad found or not?".
Actually you have drawn my attention to an important clue. The correct
hull.scad file does not reference PHI on line 7. The file which does is
tests/hull.scad. And tests/hull.scad does include ../hull.scad, so this
explains much of what's going on . It sounds like the directory structure
may have been collapsed when BOSL2 was unzipped. The BOSL2 directory
doesn't have the right files and folder structure in it.
Ahh.. that's probably it.
--
Sent from: http://forum.openscad.org/