Removed usage of upcube()

This commit is contained in:
Revar Desmera 2019-04-23 15:59:43 -07:00
parent 7115dcaeed
commit 06a460f757
7 changed files with 18 additions and 14 deletions

View file

@ -40,7 +40,7 @@ A lot of the features of this library are to allow shorter, easier-to-read, inte
[`BOSL2/shapes.scad`](https://github.com/revarbat/BOSL2/wiki/shapes.scad) Examples | Raw OpenSCAD Equivalent
---------------------------------- | -------------------------------
`upcube([10,20,30]);` | `translate([0,0,15]) cube([10,20,30], center=true);`
`cube([10,20,30], anchor=BOTTOM);` | `translate([0,0,15]) cube([10,20,30], center=true);`
`cuboid([20,20,30], fillet=5, edges=EDGES_Z_ALL);` | `minkowski() {cube([10,10,20], center=true); sphere(r=5, $fn=32);}`
`prismoid([30,40],[20,30],h=10);` | `hull() {translate([0,0,0.005]) cube([30,40,0.01], center=true); translate([0,0,9.995]) cube([20,30,0.01],center=true);}`
`xcyl(l=20,d=4);` | `rotate([0,90,0]) cylinder(h=20, d=4, center=true);`

View file

@ -58,7 +58,7 @@ function anchorpt(name, pos=[0,0,0], dir=UP, rot=0) = [name, pos, dir, rot];
// Usage:
// find_anchor(anchor, h, size, [size2], [shift], [edges], [corners]);
// Description:
// Generates a list of typical anchors.
// Returns anchor data for the given vector or anchor name.
// Arguments:
// anchor = Vector or named anchor string.
// h = Height of the region.

View file

@ -11,7 +11,7 @@
//////////////////////////////////////////////////////////////////////
// Section: Generalized Hull
// Section: Convex Hulls
// Function: convex_hull()
// Usage:
@ -32,8 +32,6 @@ function convex_hull(points) =
// Section: 2D Hull
// Function: convex_hull2d()
// Usage:
// convex_hull2d(points)
@ -96,8 +94,6 @@ function _remove_conflicts_and_insert_point(polygon, conflicts, point) =
// Section: 3D Hull
// Function: convex_hull3d()
// Usage:
// convex_hull3d(points)

7
foo.scad Normal file
View file

@ -0,0 +1,7 @@
include <BOSL2/std.scad>
cube([20,4,4], anchor=TOP+FRONT) {
attach(FRONT, BACK) cube([20,20,4]);
attach(TOP, BOTTOM) cube([20,4,20]);
attach(TOP+FRONT, norot=true) recolor("green") interior_fillet(l=20, r=10, orient=ORIENT_XNEG);
}

View file

@ -271,7 +271,8 @@ function simplify_path_indexed(points, path, eps=EPSILON, _a=0, _b=2, _acc=[]) =
// point_in_polygon(point, path)
// Description:
// This function tests whether the given point is inside, outside or on the boundary of
// the specified polygon using the Winding Number method. (http://geomalgorithms.com/a03-_inclusion.html)
// the specified polygon using the Winding Number method:
// - (http://geomalgorithms.com/a03-_inclusion.html)
// The polygon is given as a list of points, not including the repeated end point.
// Returns -1 if the point is outside the polyon.
// Returns 0 if the point is on the boundary.

View file

@ -1,6 +1,6 @@
#!/bin/bash
PREVIEW_LIBS="constants compat attachments math arrays vectors matrices coords geometry triangulation quaternions convex_hull transforms primitives shapes masks paths beziers metric_screws threading involute_gears sliders joiners linear_bearings nema_steppers wiring phillips_drive torx_drive debug"
PREVIEW_LIBS="compat attachments math arrays vectors matrices coords geometry triangulation quaternions convex_hull constants transforms primitives shapes masks paths beziers metric_screws threading involute_gears sliders joiners linear_bearings nema_steppers wiring phillips_drive torx_drive debug"
dir="$(basename $PWD)"
if [ "$dir" = "BOSL2" ]; then

View file

@ -133,7 +133,7 @@ module cuboid(
if (corner_edge_count(edges, [xa,ya,za]) > 2) {
translate(vmul([xa,ya,za]/2, size-[1,1,1]*chamfer*4/3)) {
rot(from=UP, to=[xa,ya,za]) {
upcube(chamfer*3);
cube(chamfer*3, anchor=BOTTOM);
}
}
}
@ -1543,7 +1543,7 @@ module sparse_strut3d(h=50, l=100, w=50, thick=3, maxang=40, strut=3, max_bridge
if (zreps>1) {
back(cross_len/2) {
zrot(-cross_ang) {
down(strut) upcube([strut, strut, zstep+strut]);
down(strut) cube([strut, strut, zstep+strut], anchor=BOTTOM);
}
}
}
@ -1551,7 +1551,7 @@ module sparse_strut3d(h=50, l=100, w=50, thick=3, maxang=40, strut=3, max_bridge
yflip_copy() {
back(soff*supp_step) {
skew_xy(ya=supp_ang) {
upcube([strut, strut, zstep]);
cube([strut, strut, zstep], anchor=BOTTOM);
}
}
}
@ -1712,8 +1712,8 @@ module pie_slice(
//
// Example:
// union() {
// translate([0,2,-4]) upcube([20, 4, 24]);
// translate([0,-10,-4]) upcube([20, 20, 4]);
// translate([0,2,-4]) cube([20, 4, 24], anchor=BOTTOM);
// translate([0,-10,-4]) cube([20, 20, 4], anchor=BOTTOM);
// color("green") interior_fillet(l=20, r=10, orient=ORIENT_XNEG);
// }
//