Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Customizable OpenBuilds V-Slot Rails, Using 2D Extrusion and render() Command, Allowing Each Working Face to be Closed or Slotted
- /* [General] */
- // Height (Y) of Extrusion Profile End View
- VRailHeight = 20;
- // Width (X) of Extrusion Profile End View
- VRailWidth = 20;
- // Length (Z) of Extruded Part
- VRailLength = 10;
- // Begin Rendering
- VRailVitamin(Slots=1);
- // Define Modules
- module VRailProfile() {
- /* [Profile] */
- VWCenter = VRailWidth / 2;
- VHCenter = VRailHeight / 2;
- // Define Profile
- difference() {
- square([VRailWidth, VRailHeight]);
- for (i=[1:1:3]) {
- translate ([VWCenter,VHCenter]) {
- translate([(VWCenter-0.5),(VHCenter-0.5)]) {
- render() SquareFillets();
- };
- rotate([0,0,90*i]) {
- translate([(VWCenter-0.5),(VHCenter-0.5)]) {
- SquareFillets();
- };
- };
- };
- };
- translate ([VWCenter,VHCenter]) {
- circle(2.1,$fn=15);
- };
- for (i=Slots) {
- translate ([VWCenter,VHCenter]) {
- rotate([0,0,90*i]) {
- translate ([0,-VHCenter]) {
- VSlot();
- };
- };
- };
- };
- };
- // Define subModules
- module SquareFillets () {
- difference() {
- square(1);
- circle(0.5,$fn=15);
- };
- };
- module VSlot () {
- VSlotHalf();
- mirror([1,0]) VSlotHalf();
- module VSlotHalf() {
- polygon (points = [[0,-1],[0,6.31],[0.21,6.1],[2.839,6.1],[5.5,3.439],[5.5,1.8],[3.125,1.8],[3.125,1.455],[5.58,-1]]);
- };
- };
- };
- module VRailVitamin (VRailWidth=VRailWidth, VRailHeight=VRailHeight,Slots=[1,2,3,4]) { // This set of parameters was originally defined for VRailProfile(). Leaving it defined there and here while calling VRailVitamin with a Slots[] value does not pass the value, even if I add Slots to the VRailProfile() call below.
- linear_extrude(height=1, convexity=10) VRailProfile();
- };
- //EOD
Add Comment
Please, Sign In to add comment