Browse Source

Extracted common code out

master
Dejvino 3 years ago
parent
commit
58fc149bbe
7 changed files with 51 additions and 22 deletions
  1. +11
    -0
      src/common.scad
  2. +1
    -7
      src/harness.scad
  3. +1
    -1
      src/main.scad
  4. +3
    -7
      src/platform.scad
  5. +21
    -0
      src/platform_common.scad
  6. +9
    -5
      src/strap.scad
  7. +5
    -2
      src/strap_common.scad

+ 11
- 0
src/common.scad View File

@@ -0,0 +1,11 @@
use <BOSL/shapes.scad>
include <BOSL/constants.scad>

module cubi(s, fillet=0, edges=EDGES_ALL) {
if ($preview) {
cube(s, center=true);
} else {
cuboid(s, fillet=fillet, edges=edges);
}
}


+ 1
- 7
src/harness.scad View File

@@ -22,13 +22,7 @@ function use_slideout_backplane() = is_model_strict(MODEL_HARNESS_BOTTOM_PIP) ||

backplane_pip_slideout=10;

module cubi(s, fillet=0, edges=EDGES_ALL) {
if ($preview) {
cube(s, center=true);
} else {
cuboid(s, fillet=fillet, edges=edges);
}
}
use <common.scad>

module dotted_grill_cutout(vents_area, vents_x=10, vents_y=10, mesh=1.5, cut_corners=false) {
function is_corner(x, y, xm, ym) = (x == 0 || x == xm) && (y == 0 || y == ym);


+ 1
- 1
src/main.scad View File

@@ -3,4 +3,4 @@ include <export.scad>

include <harness.scad>
include <platform.scad>
//include <strap.scad>
include <strap.scad>

+ 3
- 7
src/platform.scad View File

@@ -11,6 +11,7 @@ use <specs_platform.scad>
use <specs_strap.scad>

use <strap_common.scad>
use <platform_common.scad>

// DEBUG:
//validation = 1;
@@ -40,13 +41,8 @@ module platform(base) {
cube(size, center=true);
module strap_connectors() {
offset=get_platform_strap_connector_offset();
down(size.z/2) {
for (i=[0:3]) {
translate([((i%2*(-2)+1) * offset.x), -((round(i/2)%2*(-2)+1) * offset.y), offset.z])
zrot(90 + (round(i/2)%2*180))
link_connector_pin();
}
down(size.z/2) foreach_platform_strap_connector() {
link_connector_pin();
}
}


+ 21
- 0
src/platform_common.scad View File

@@ -0,0 +1,21 @@
// dependency: https://github.com/revarbat/BOSL
include <BOSL/constants.scad>
use <BOSL/transforms.scad>
use <BOSL/shapes.scad>
use <BOSL/masks.scad>
use <BOSL/sliders.scad>

use <specs_platform.scad>
use <specs_strap.scad>

use <strap_common.scad>

module foreach_platform_strap_connector() {
offset=get_platform_strap_connector_offset();
for (i=[0:3]) {
translate([((i%2*(-2)+1) * offset.x), -((round(i/2)%2*(-2)+1) * offset.y), offset.z])
zrot(90 + (round(i/2)%2*180))
children();
}
}


+ 9
- 5
src/strap.scad View File

@@ -6,6 +6,8 @@ use <BOSL/transforms.scad>
use <BOSL/shapes.scad>
include <BOSL/constants.scad>

use <specs_platform.scad>

use <strap_common.scad>

if (is_model_strict(MODEL_LINKS)) {
@@ -249,11 +251,13 @@ module clip_ratcheting(ratchet_length=28) {

// === Export ===
if (is_model(MODEL_DEMO)) {
translate([-20, -40, -10]) zrot(-90) {
link_chain(links_count, include_terminal=include_terminal);
right(links_count * get_link_segment_size().x + get_link_clip_size().x) {
clip();
right(get_link_clip_size().x) clip_ratcheting();
foreach_platform_strap_connector() {
zrot(180) down(get_link_segment_size().z/2) {
link_chain(links_count, include_terminal=include_terminal);
/*right(links_count * get_link_segment_size().x + get_link_clip_size().x) {
clip();
right(get_link_clip_size().x) clip_ratcheting();
}*/
}
}
} else {


+ 5
- 2
src/strap_common.scad View File

@@ -6,6 +6,8 @@ include <BOSL/constants.scad>

use <specs_strap.scad>

use <common.scad>

module pin() {
segment_size=get_link_segment_size();
h=segment_size.y;
@@ -33,7 +35,7 @@ module pin_socket() {
module arm() {
segment_size=get_link_segment_size();
arm_size=get_link_joiner_arm_size();
fwd(segment_size.y/2 + arm_size.y/2 - 1) right(arm_size.x/2 - 1) cuboid(arm_size, fillet=1, edges=EDGES_FRONT + EDGES_Y_ALL);
fwd(segment_size.y/2 + arm_size.y/2 - 1) right(arm_size.x/2 - 1) cubi(arm_size, fillet=1, edges=EDGES_FRONT + EDGES_Y_ALL);
}
module armFront() {
arm();
@@ -46,9 +48,10 @@ module armJoiner() {
arm_size=get_link_joiner_arm_size();
segment_size=get_link_segment_size();
joiner_size=[arm_size.x-get_link_socket_size().x, segment_size.y, segment_size.z];
right(joiner_size.x/2 + get_link_socket_size().x/2 + gap) cuboid(joiner_size, fillet=1, edges=EDGES_Z_ALL + EDGES_BOTTOM);
right(joiner_size.x/2 + get_link_socket_size().x/2 + gap) cubi(joiner_size, fillet=1, edges=EDGES_Z_ALL + EDGES_BOTTOM);
}
module link_arms() {
$fn=$preview?4:20;
armFront();
armBack();
armJoiner();


Loading…
Cancel
Save