Giter Site home page Giter Site logo

chamfers-for-openscad's People

Contributors

sebitimewaster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

chamfers-for-openscad's Issues

Improvement of chamferCylinder function : specify the number of segments

Purpose to have a possibility to define the number of segments.
Useful to create an hexagon (nut) for example.

By mofifying the circleSegments:
function circleSegments(r, q = -1.0) = ($fn>0) ? $fn : ((r * PI * 4 + 40) * ((q >= 0.0) ? q : globalCircleQuality));

Example to use:
chamferCylinder(r=8,h=8,$fn=8,ch2=0);

A more susinct way to specify edge `chamfers` on a `chamferCube`

I'm loving your library so far! Thank you so much.
I've only used chamferCube so far. Therefore I don't know if the following concept would apply well elsewhere.

I'm thinking of modifying the chamferCube to add an additional option param similar to:

  * @param  chamfers  Which chamfers to render along the [x, y, z] axis, 
  *                     example: [[0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 0, 0]]
  *                     X axis: 4 values in clockwise order starting from 
  *                     the zero point, as seen from "Left view" (Ctrl + 6)
  *                     Y axis: 4 values in clockwise order starting from
  *                     the zero point, as seen from "Front view" (Ctrl + 8)
  *                     Z axis: 4 values in clockwise order starting from
  *                     the zero point, as seen from "Bottom view" (Ctrl + 5)

The param would take an oct/hex representation of the chamfers 2D vector. The conversion would be very similar to the way Unix file permissions read, write, executeare represented as1, 2, 4and any combination can be represented by the range 1-7. But in the case of 4 corners for a square, you need to use1, 2, 4, 8`.

[1, 0, 1, 0] = 5
[0, 0, 1, 1] = 12
[0, 1, 1, 1] = 14

While the example above could be represented as 5CE, I don't favor it for a few reasons:

  • I don't think most people can think in hex clearly.
  • This model breaks down for faces with greater than 4 edges.
  • I would like to avoid the need for quotes, especially if the values will ever go into vectors.

I would like to get your input before I start coding something up. I'd like to do it in a way that you might consider accepting as a PR.

A few questions I have:

  • What to name the param? (maybe: ch0)
  • How to represent it? (maybe: [5, 12, 14] or "5 12 14"?)
  • Do you have (or plan to have) any other objects this might also apply to?
  • Are there any gotchas you can think of?

Common surfaces issue when using chamferedCylinder with difference()

This file demonstrates the issue:

$fn = 120;

include <Chamfers-for-OpenSCAD/Chamfer.scad>;

difference() {
  cube( [ 20, 20, 10 ] );
  translate( [ 10, 10, -1 ] ) chamferCylinder( r = 5, h = 12, ch = - 2, ch2 = - 2 );
  translate( [ -1, -1, -1 ] ) cube( [ 22, 11, 12 ] );
}

translate( [ 30, 10, -1 ] ) chamferCylinder( r = 5, h = 12, ch = - 2, ch2 = - 2 );

Although I've made the chamferedCylinder a bit higher than the cube, the preview (F5) shows a hole that does not go through.

Suggestion for a fix:

Edit:
I just realized that my suggested fix works only for negative chamfers. This is the one that works for both:

117c117
<         translate([0, 0, abs(chamferHeight)]) cylinder(height - abs(chamferHeight2) - abs(chamferHeight), r1 = radius, r2 = radius2, $fn = circleSegments(max(radius, radius2), quality));
---
>         translate([0, 0, chamferHeight > 0 ? chamferHeight : 0]) cylinder(height - (chamferHeight2 > 0 ? chamferHeight2 : 0) - (chamferHeight > 0 ? chamferHeight : 0), r1 = radius, r2 = radius2, $fn = circleSegments(max(radius, radius2), quality));

Option of specifying center

First off, great library! Just wanted to say it would be a nice to be able to specify whether the produced object is to be centered, or not, as in the vanilla OpenSCAD primitives, by specifying center=true. Similiarly being able to specify diameter rather than radius, so that chamferCylinder can be used as a drop-in replacement for cylinder, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.