Quantcast

Circular shape to a square shape.

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Circular shape to a square shape.

Paulo Vitor Oliveira
Hi, I'm new to the software and I have a question. I have a file of a circular piece, and I would like to make it a square piece Preserving the details, but I do not know how to make the modification. The link of the part is down.

twisted_vase.scad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Circular shape to a square shape.

fred_dot_u
I have noted in the code you provide that there is a line
faces = 8;

When that value is changed to 4, the individual "layers" of the shape become square. Is this the answer you seek?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Circular shape to a square shape.

Paulo Vitor Oliveira
Thanks for the response !
No... This is the image of the code

I want to know if it is possible to change the shape that is like a cup, to something like a box, for exemple, including this special details. The changes that you proposed, only make difference on the details.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Circular shape to a square shape.

fred_dot_u
The "special details" part escapes me. The method used in the original cup-type code is to rotate the basic shape (faces) which provides what I think of as the details. If "faces = 4" is used, each layer is a square.



If one desires a cube shaped receptacle, this code:

difference(){
    cube([75, 75, 32.5]);
    translate([3, 3, 3])
        cube([69, 69, 39]);
}

gives this shape:



Can you clarify what special details you seek?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Circular shape to a square shape.

Paulo Vitor Oliveira
Thanks man ! I`m really a new one on openscad.

I understood that using faces = 4 then we have the image you upload, but it is possible to have  that number of "special details", that number of faces, but this details on the sides of a box ?

I`ll tried to explain better... On this code, we have some subdivisions and some number os "special details"

But, besides become a "cup" at the and, besides creates this details on a cylinder, now create on the sides of a box, its possible ?

Thanks !
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Circular shape to a square shape.

fred_dot_u
I see that you'd like to have facets on the sides of the box. The facets in the faces=8 are really rotations of the basic shape. When that is done with faces=4, you get the image I provided, but I think you feel that the variations are too great and would like to have more subtle changes to the faces.

I'm mostly new to OpenSCAD too and not much of a programmer-thinking kind of person. Most of my creations are simple and involve a lot of "try this, fail, try something else."

I believe that there is someone on the list who has strong programming skills and can create complex code to create facets on the faces of the cube. I believe that I would have very little understanding of the code, however.

If, for example, you desired to have one "point of facet" in the side of the cube, I could manually create polygons, but it would be "brute force" generation, while a more skilled user would create algorithms to accomplish the same thing, and with more flexibility.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Circular shape to a square shape.

codifies
make a giant version with many tiny (it its scale) facets, difference
out a piece that is the size of one box wall, if you have made the giant
version big enough it should look almost flat at the smaller scale...

use this 4 times rotated 90 degrees each time to make the four sides

check the wiki / manual etc to see how boolean geometry is used
(difference and union I abuse a lot!)

hope this is enough to get you started / learning

Chris


On 09/04/17 01:14, fred_dot_u wrote:

> I see that you'd like to have facets on the sides of the box. The facets in
> the faces=8 are really rotations of the basic shape. When that is done with
> faces=4, you get the image I provided, but I think you feel that the
> variations are too great and would like to have more subtle changes to the
> faces.
>
> I'm mostly new to OpenSCAD too and not much of a programmer-thinking kind of
> person. Most of my creations are simple and involve a lot of "try this,
> fail, try something else."
>
> I believe that there is someone on the list who has strong programming
> skills and can create complex code to create facets on the faces of the
> cube. I believe that I would have very little understanding of the code,
> however.
>
> If, for example, you desired to have one "point of facet" in the side of the
> cube, I could manually create polygons, but it would be "brute force"
> generation, while a more skilled user would create algorithms to accomplish
> the same thing, and with more flexibility.
>
>
>
> --
> View this message in context: http://forum.openscad.org/Circular-shape-to-a-square-shape-tp21129p21137.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Circular shape to a square shape.

Ronaldo
In reply to this post by Paulo Vitor Oliveira
Paulo,

I don't think you may reproduce that same texture pattern in the planar surface of a block. To enlarge the circular form to make it seem locally plane will make the texture too shallow to give the same visual effect.

The simplest way I can imagine to create planar textures is to use a texture map with the OpenSCAD primitive surface(). The very crude example of its application in mapping texture follows as a base point to your experiments. The commented lines at the beginning of the code should be saved as a text file named texture.txt. It is a shame we can't use a matrix defined in the code as input to surface().

/*
# texture.txt
2 2 3 2 3 2 3 2 3 2 3 2 2
2 3 2 3 2 3 2 3 2 3 2 3 2
2 2 3 2 3 2 3 2 3 2 3 2 2
2 3 2 3 2 3 2 3 2 3 2 3 2
2 2 3 2 3 2 3 2 3 2 3 2 2
2 3 2 3 2 3 2 3 2 3 2 3 2
2 2 3 2 3 2 3 2 3 2 3 2 2
2 3 2 3 2 3 2 3 2 3 2 3 2
2 2 3 2 3 2 3 2 3 2 3 2 2
2 3 2 3 2 3 2 3 2 3 2 3 2
2 2 3 2 3 2 3 2 3 2 3 2 2
2 3 2 3 2 3 2 3 2 3 2 3 2
2 2 3 2 3 2 3 2 3 2 3 2 2
2 3 2 3 2 3 2 3 2 3 2 3 2
*/

width = 13; // # columns in texture.txt
height = 14;// # lines in texture.txt
thick = 3;  // max value in texture.txt

module wall()
    intersection(){
        rotate(-135) translate([0,0,-height/2-1]) cube([width/sqrt(2),width/sqrt(2),height+2]);
    translate([-0.01,-(width-4-thick)/2,0])
        rotate([90,0,0])
            surface(file="texture.txt",center=true);
    }
   
wall();
rotate(90) wall();
rotate(180) wall();
rotate(270) wall();


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Circular shape to a square shape.

kintel
Administrator
There is also this:

https://github.com/openscad/list-comprehension-demos#forma-candle-holderscad

..a different way of achieving smth. similar, and uses a bunch of library code, but perhaps helpful?

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Loading...