optimize stls
This commit is contained in:
@ -66,8 +66,6 @@ module connectorPositive(on, to) {
|
||||
onYBarToXBarPositive();
|
||||
} else if (on == "yBar" && to == "basePlate") {
|
||||
onYBarBasePlateConnectorPositive();
|
||||
} else if (on == "xBar" && to == "yBar") {
|
||||
onXBarToYBarPositive();
|
||||
} else if (on == "mainRail" && to == "yBar") {
|
||||
onMainRailYBarConnectorPositive();
|
||||
}
|
||||
|
||||
@ -35,22 +35,6 @@ module onXBarToYBarNegative() {
|
||||
translate(v = [-xBarSideThickness, y, z])
|
||||
rotate(a = [0, -90, 0])
|
||||
counterSunkHead_N(rackFrameScrewType, screwExtension=inf10, headExtension=inf10);
|
||||
|
||||
// lugs for snap fit and hold in place
|
||||
translate(v=[-0.1,3,13.5])
|
||||
lug();
|
||||
|
||||
translate(v=[-0.1,26,13.5])
|
||||
lug();
|
||||
}
|
||||
|
||||
module onXBarToYBarPositive() {
|
||||
// lugs for snap fit and hold in place
|
||||
translate(v=[-0.1,3,2])
|
||||
lug();
|
||||
|
||||
translate(v=[-0.1,26,2])
|
||||
lug();
|
||||
}
|
||||
|
||||
|
||||
@ -62,13 +46,6 @@ module onYBarToXBarNegative() {
|
||||
rotate(a = [180, 0, 0])
|
||||
rotate(a = [0, 90, 0])
|
||||
hexNutPocket_N("m3", openSide=false, backSpace=5);
|
||||
|
||||
// lugs for snap fit and hold in place
|
||||
translate(v=[-0.1,3,2])
|
||||
lug();
|
||||
|
||||
translate(v=[-0.1,26,2])
|
||||
lug();
|
||||
}
|
||||
|
||||
module onYBarToXBarPositive() {
|
||||
@ -87,26 +64,8 @@ module onYBarToXBarPositive() {
|
||||
backFaceLength = 5,
|
||||
backFaceScale = 1.2
|
||||
);
|
||||
|
||||
// lugs for snap fit and hold in place
|
||||
translate(v=[-0.1,3,13.5])
|
||||
lug();
|
||||
|
||||
translate(v=[-0.1,26,13.5])
|
||||
lug();
|
||||
}
|
||||
|
||||
|
||||
xBarConnectorToYBarConnectorTrans = mirror(v=[1,0,0]);
|
||||
yBarConnectorToXBarConnectorTrans = mirror(v=[-1,0,0]);
|
||||
|
||||
|
||||
|
||||
module lug() {
|
||||
hull() {
|
||||
sphere(r=0.5);
|
||||
|
||||
translate(v=[0,2,0])
|
||||
sphere(r=0.5);
|
||||
}
|
||||
}
|
||||
@ -2,8 +2,8 @@ include <../xBar.scad>
|
||||
include <../yBar.scad>
|
||||
include <../mainRail.scad>
|
||||
|
||||
|
||||
// Evaluation print for slack config
|
||||
// Evaluation print for slack config, please see slack.scad
|
||||
// to configure tolerances
|
||||
|
||||
intersection() {
|
||||
yBar();
|
||||
@ -14,16 +14,15 @@ translate(v=[35,0,0])
|
||||
intersection() {
|
||||
translate(v=[0,-xBarX + xBarSideThickness + 5,0])
|
||||
xBar();
|
||||
|
||||
halfspace(vpos=[0,1,0], p=[0,0,0]);
|
||||
}
|
||||
|
||||
translate(v=[60,20,0])
|
||||
translate(v=[35,18,0])
|
||||
rotate(a=[0,0,90])
|
||||
intersection() {
|
||||
mirror(v=[0,1,0])
|
||||
multmatrix(mainRailPrintOrientation)
|
||||
mainRail();
|
||||
|
||||
halfspace(vpos=[-1,0,0], p=[19,0,0]);
|
||||
|
||||
mainRailPrintOrientation = [
|
||||
|
||||
15
rbuild.py
15
rbuild.py
@ -4,6 +4,7 @@ import argparse
|
||||
import subprocess
|
||||
import os
|
||||
import sys
|
||||
from stl import mesh, stl
|
||||
|
||||
|
||||
# For actual dimensions, please see profiles.scad.
|
||||
@ -82,7 +83,10 @@ def run_build(build_var, config_var):
|
||||
|
||||
def build_single(build_dir, target_dir, filename, config):
|
||||
print('Building:', filename, 'from', build_dir, 'to', target_dir)
|
||||
run_openscad(construct_openscad_args(build_dir, target_dir, filename, config))
|
||||
openscad_args = construct_openscad_args(build_dir, target_dir, filename, config)
|
||||
run_openscad(openscad_args)
|
||||
|
||||
convert_text_stl_to_binary(openscad_args[1])
|
||||
|
||||
|
||||
def construct_openscad_args(build_dir, target_dir, filename, config):
|
||||
@ -128,6 +132,15 @@ def run_openscad(options=['-h']):
|
||||
'(Currently need Linux for this)')
|
||||
|
||||
|
||||
def convert_text_stl_to_binary(file_path):
|
||||
mesh_data = mesh.Mesh.from_file(file_path)
|
||||
|
||||
# Remove the original file
|
||||
os.remove(file_path)
|
||||
|
||||
mesh_data.save(file_path, mode=stl.Mode.BINARY)
|
||||
|
||||
|
||||
def assert_os():
|
||||
if sys.platform == 'linux':
|
||||
return True
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user