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

Weird render glitch #3878

Closed
CAPSBOY opened this issue Sep 11, 2021 · 9 comments
Closed

Weird render glitch #3878

CAPSBOY opened this issue Sep 11, 2021 · 9 comments

Comments

@CAPSBOY
Copy link

CAPSBOY commented Sep 11, 2021

I have a VESA mount SCAD file that the screw holes on one side render fine but the other side is a glitchy mess

@MichaelAtOz
Copy link
Member

@CAPSBOY perhaps something like this?

@CAPSBOY
Copy link
Author

CAPSBOY commented Sep 11, 2021

thats the one ... thank you so much ill have a look and see if its fixed

@CAPSBOY
Copy link
Author

CAPSBOY commented Sep 11, 2021

{
cube([plate_square_side,plate_square_side,plate_thickness],
center=true);
holes();
}
reading the fix the code is like this and every time I edit it it wont render

@MichaelAtOz
Copy link
Member

@CAPSBOY Either you are not providing all the details or they are not making it to the final post.

Reading between the lines, you need holes() to be a small amount below the cube, and to extend a small amount above the cube. So it is basically pushing through both the top & bottom of the cube.

tiny=0.025;
size=10;
// using center makes it easy, no need to translate
difference() {
  cube([size,size,size],center=true);
    cylinder(h=size+2*tiny,r=size/3,center=true);
}

// or
translate([size*2,0,0])
  difference() {
    cube([size,size,size]);
    translate([size/2,size/2,-tiny])  // drop below bottom of cube
      cylinder(h=size+2*tiny,r=size/3); // extend above top of cube
  }

@CAPSBOY
Copy link
Author

CAPSBOY commented Sep 12, 2021

$fn=20;

ball_dia = 25;
cyl_dia = 11;
cyl_height = 12;
correction=2;
plate_thickness = 6;
plate_countersink_dia = 10;
plate_countersink_depth = 3;
plate_square_side = 85;
screw_dia=4;

// Given that we're rotating 45 degrees and that also helpfully
// is the "deepest" part of our rotation, we can calculate the
// ratio of the hypotenuse to the distance to a side of the square
// to find where the distance to our holes pattern.
ratio = (
sqrt(
(pow((plate_square_side/2),2))
+(pow((plate_square_side/2),2))
)
/(plate_square_side/2));

mount_spacing = (75/2)*ratio;

start_tube = (ball_dia/2)-correction;

sphere(d=ball_dia);

translate([0,0,start_tube]){
cylinder(d=cyl_dia,h=cyl_height+correction);
}

translate([0,0,start_tube
+cyl_height
+correction
+plate_thickness
-(plate_thickness/2)]
) {
plate();
}

module holes()
{
for(a = [45:90:405])
{
rotate(a) {
translate([mount_spacing,0,-plate_thickness/2]) {
cylinder(d=screw_dia, h=plate_thickness*2);
cylinder(d=plate_countersink_dia,h=plate_countersink_depth);
}
}
}
}

module plate()
{
difference()
{
cube([plate_square_side,plate_square_side,plate_thickness],
center=true);
holes();
}
}

Here is the code in full
funny your right two of the same parts are glitched, ive tried to add that code and it renders weird.
cheers

@MichaelAtOz
Copy link
Member

When posting code use the <> icon above, or use three backticks (```) on a line before & after the code.

Here I moved the two cylinders down by 1, and made them longer by 1.
So they break through the surface of the plate.

module holes()
{
  for(a = [45:90:405])
  {
    rotate(a) {
      translate([mount_spacing,0,-plate_thickness/2-1]) {
        cylinder(d=screw_dia, h=plate_thickness*2+1);
        cylinder(d=plate_countersink_dia,h=plate_countersink_depth+1);
      }
    }
  }
}

@MichaelAtOz
Copy link
Member

When posting code use the <> icon above,

As in 'above' in the GitHub edit box.
If you are emailing, indent the code and use courier/mono spaced font.

@MichaelAtOz
Copy link
Member

I think this is done. @t-paul should I remove the feedback label on closing?

@t-paul
Copy link
Member

t-paul commented Oct 5, 2022

I removed it now, but usually it does not matter much as in most searches the closed are excluded anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants