Skip to content

Comments

Fix beamChain right-angles#55

Open
LazerPlatypus wants to merge 1 commit intoIrev-Dev:masterfrom
LazerPlatypus:beam-chain_right-angle-fix
Open

Fix beamChain right-angles#55
LazerPlatypus wants to merge 1 commit intoIrev-Dev:masterfrom
LazerPlatypus:beam-chain_right-angle-fix

Conversation

@LazerPlatypus
Copy link

Fix findPoint function to handle is90or270 properly by checking for undef rather than 0

Existing behavior does not handle right-angles in beamChain correctly.
This was fixed previously, but there may have been regression with a change of OpenSCAD treating '0' as falsy before, and not now, However, I cannot confirm this.

The code snippit below used to cause the following error:
WARNING: cos() parameter could not be converted: argument 0: expected number, found string ("error") in file <Round-Anything/polyround.scad>, line 687

use <Round-Anything/polyround.scad>;
let (
    beam_radii_points = beamChain(
        radiiPoints=[[0, 0, 0], [40, 0, 0], [40, 40, 0], [0, 40, 0]],
        offset1=0.5,
        offset2=-0.5,
        startAngle=90,
        endAngle=90,
        mode=0,
    )
) {
    polyRoundExtrude(
        radiiPoints= beam_radii_points,
        length=5,
        r1=0,
        r2=0,
        fn=20,
        convexity=30,
    );
}

The above code now (correctly) creates the following model:
image

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant