optimize stls
This commit is contained in:
@ -66,8 +66,6 @@ module connectorPositive(on, to) {
|
|||||||
onYBarToXBarPositive();
|
onYBarToXBarPositive();
|
||||||
} else if (on == "yBar" && to == "basePlate") {
|
} else if (on == "yBar" && to == "basePlate") {
|
||||||
onYBarBasePlateConnectorPositive();
|
onYBarBasePlateConnectorPositive();
|
||||||
} else if (on == "xBar" && to == "yBar") {
|
|
||||||
onXBarToYBarPositive();
|
|
||||||
} else if (on == "mainRail" && to == "yBar") {
|
} else if (on == "mainRail" && to == "yBar") {
|
||||||
onMainRailYBarConnectorPositive();
|
onMainRailYBarConnectorPositive();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,22 +35,6 @@ module onXBarToYBarNegative() {
|
|||||||
translate(v = [-xBarSideThickness, y, z])
|
translate(v = [-xBarSideThickness, y, z])
|
||||||
rotate(a = [0, -90, 0])
|
rotate(a = [0, -90, 0])
|
||||||
counterSunkHead_N(rackFrameScrewType, screwExtension=inf10, headExtension=inf10);
|
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 = [180, 0, 0])
|
||||||
rotate(a = [0, 90, 0])
|
rotate(a = [0, 90, 0])
|
||||||
hexNutPocket_N("m3", openSide=false, backSpace=5);
|
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() {
|
module onYBarToXBarPositive() {
|
||||||
@ -87,26 +64,8 @@ module onYBarToXBarPositive() {
|
|||||||
backFaceLength = 5,
|
backFaceLength = 5,
|
||||||
backFaceScale = 1.2
|
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]);
|
xBarConnectorToYBarConnectorTrans = mirror(v=[1,0,0]);
|
||||||
yBarConnectorToXBarConnectorTrans = 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 <../yBar.scad>
|
||||||
include <../mainRail.scad>
|
include <../mainRail.scad>
|
||||||
|
|
||||||
|
// Evaluation print for slack config, please see slack.scad
|
||||||
// Evaluation print for slack config
|
// to configure tolerances
|
||||||
|
|
||||||
intersection() {
|
intersection() {
|
||||||
yBar();
|
yBar();
|
||||||
@ -14,16 +14,15 @@ translate(v=[35,0,0])
|
|||||||
intersection() {
|
intersection() {
|
||||||
translate(v=[0,-xBarX + xBarSideThickness + 5,0])
|
translate(v=[0,-xBarX + xBarSideThickness + 5,0])
|
||||||
xBar();
|
xBar();
|
||||||
|
|
||||||
halfspace(vpos=[0,1,0], p=[0,0,0]);
|
halfspace(vpos=[0,1,0], p=[0,0,0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
translate(v=[60,20,0])
|
translate(v=[35,18,0])
|
||||||
rotate(a=[0,0,90])
|
rotate(a=[0,0,90])
|
||||||
intersection() {
|
intersection() {
|
||||||
|
mirror(v=[0,1,0])
|
||||||
multmatrix(mainRailPrintOrientation)
|
multmatrix(mainRailPrintOrientation)
|
||||||
mainRail();
|
mainRail();
|
||||||
|
|
||||||
halfspace(vpos=[-1,0,0], p=[19,0,0]);
|
halfspace(vpos=[-1,0,0], p=[19,0,0]);
|
||||||
|
|
||||||
mainRailPrintOrientation = [
|
mainRailPrintOrientation = [
|
||||||
|
|||||||
15
rbuild.py
15
rbuild.py
@ -4,6 +4,7 @@ import argparse
|
|||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from stl import mesh, stl
|
||||||
|
|
||||||
|
|
||||||
# For actual dimensions, please see profiles.scad.
|
# 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):
|
def build_single(build_dir, target_dir, filename, config):
|
||||||
print('Building:', filename, 'from', build_dir, 'to', target_dir)
|
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):
|
def construct_openscad_args(build_dir, target_dir, filename, config):
|
||||||
@ -128,6 +132,15 @@ def run_openscad(options=['-h']):
|
|||||||
'(Currently need Linux for this)')
|
'(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():
|
def assert_os():
|
||||||
if sys.platform == 'linux':
|
if sys.platform == 'linux':
|
||||||
return True
|
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