Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ydistribute is offset #91

Open
tree68505 opened this issue Sep 26, 2022 · 0 comments
Open

[BUG] ydistribute is offset #91

tree68505 opened this issue Sep 26, 2022 · 0 comments
Assignees
Labels

Comments

@tree68505
Copy link

Describe the bug
ydistribute is offset by one in the negative y direction. The code must offset a cube of the same dimensions by one in the negative y direction to properly align with the distribution.

Code To Reproduce Bug

$fn=100;
include<BOSL/shapes.scad>
include<BOSL/transforms.scad>

$AA_dia = 15;
$AAA_dia = 11;
$spacing = 3;
$wiggle_room = .5;
$height = 12;
$box_x = (4*$spacing)+(4*$AA_dia);
$box_y = (2*$AA_dia)+(2*$AAA_dia)+(3*$spacing);

difference(){
//bug?
  //translate([0,-1,0])
  {
  cube([$box_x,$box_y,$height],center=true);
  }
#ydistribute(spacing=$spacing,sizes=[$AA_dia,$AA_dia,$AAA_dia,$AAA_dia]){
aa_bats();
aa_bats();
aaa_bats();
aaa_bats();
}
}
module aaa_bats()
{
  xspread(spacing=$AAA_dia+$spacing, n=5)
 { 
   cyl(l=$height+$wiggle_room,r=($AAA_dia/2));
 }
}
module aa_bats()
{
  xspread(spacing=$AA_dia+$spacing, n=4)
 { 
   cyl(l=$height+$wiggle_room,r=($AA_dia/2));
 }
}

Expected behavior
ydistrubute should center on the x-axis.

Screenshots
bug

Additional context
Add any other context about the problem here.

  • OpenSCAD Version: 2021.01
  • Other libraries used: None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants