From ca9783df5dc645a027743902f7f3b2e0348fd716 Mon Sep 17 00:00:00 2001 From: Joshua Shreve Date: Wed, 11 Aug 2021 20:55:08 -0400 Subject: Interim checkin. Initial version of trackball webs/walls in, still working on component cut/union order. Fixed base plates and walls to be identical in caquery and solid. Fixed if/elif/else structure that misplaced the MINI cluster screw mount. Added intial pass at add on PCB as option to add with caps for interference checks. Moved bottom_hull to helper libraries as they are specific to engine. Fixed bottom_hull functions to correct minor discrepency between the engines. Fixed solid intersect function. --- src/helpers_solid.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/helpers_solid.py') diff --git a/src/helpers_solid.py b/src/helpers_solid.py index 470d5e8..f5636ea 100644 --- a/src/helpers_solid.py +++ b/src/helpers_solid.py @@ -73,7 +73,7 @@ def difference(shape, shapes): def intersect(shape1, shape2): - return sl.intersect()(shape1, shape2) + return sl.intersection()(shape1, shape2) def hull_from_points(points): @@ -102,6 +102,21 @@ def triangle_hulls(shapes): return union(hulls) + +def bottom_hull(p, height=0.001): + debugprint("bottom_hull()") + shape = None + for item in p: + proj = sl.projection()(p) + t_shape = sl.linear_extrude(height=height, twist=0, convexity=0, center=True)( + proj + ) + t_shape = sl.translate([0, 0, height / 2 - 10])(t_shape) + if shape is None: + shape = t_shape + shape = sl.hull()(p, shape, t_shape) + return shape + def polyline(point_list): return sl.polygon(point_list) -- cgit v1.2.3 From 29a89e462800f26f70f22cbe05211e153339e928 Mon Sep 17 00:00:00 2001 From: Joshua Shreve Date: Tue, 17 Aug 2021 20:39:54 -0400 Subject: File cleanup. --- src/helpers_solid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/helpers_solid.py') diff --git a/src/helpers_solid.py b/src/helpers_solid.py index f5636ea..174d65a 100644 --- a/src/helpers_solid.py +++ b/src/helpers_solid.py @@ -133,9 +133,9 @@ def extrude_poly(outer_poly, inner_polys=None, height=1): return sl.linear_extrude(height=height, twist=0, convexity=0, center=True)(outer_poly) -def import_file(fname): +def import_file(fname, convexity=2): print("IMPORTING FROM {}".format(fname)) - return sl.import_(fname + ".stl") + return sl.import_stl(fname + ".stl", convexity=convexity) def export_file(shape, fname): -- cgit v1.2.3