best way to create this

classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: best way to create this

Leea
It never occurred to me to try scaling a sphere. I suppose with the
right scale and then pick the section I want I can get most any curve I
want. It would have made my last project easier where I used a really
large sphere to make a small shallow dimple. I will play with this, I
think I can get what I want.

thanks
Lee

On 2/25/2021 11:36 PM, Ron Wheeler wrote:

> Not exactly sure that I understand what you want.
>
> This is another approach where I started with a cylinder and
> subtracted the bits that I wanted to eliminate.
>
> Perhaps with the right scaling and translating of the circle, you can
> get the shape that you want.
> It will not give you triangles at the edges but will give you a nice
> concave pocket.
>
> $fn=100;
>
> height=20;
> base=30;
> difference(){
>     cylinder(h=height,r=base);
>     union(){
>       translate([-100,-50,-9]){cube([100,100,base]);}
>       translate([5,10,34]){scale([1,1.5,1]){sphere(r=35);}}
>         }
> }
>
> If this doesn't quite give you want you want, I hope it gives you some
> more ideas about how to use difference and the other tools to make
> something by subtracting shapes.
>
> Ron
>
> On 2021-02-25 11:15 p.m., Lee A wrote:
>> $fn=100;
>>
>> height=20;
>> base=30;
>>
>> for (i=[0:1:180]){
>>     rotate ([0,0,-i]){
>>         translate ([-base-3+(i/10),0,0])
>>         rotate ([270,0,0]){
>>             linear_extrude(height = 1, center = false, convexity =
>> 10, twist = 0)
>>             polygon (points=[[0,0],[0,-height+(i/15)],[base-(i/10),0]]);
>>         }
>>     }
>> }
>
> --
> Ron Wheeler
> Artifact Software
> 438-345-3369
> [hidden email]


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

I don't understand manifold message

Leea
In reply to this post by adrianv
I reduced this to the minimum to show the message.

Each of the two parts will render just fine by themselves. But when I
render them together I get a message;

UI-WARNING: Object may not be a valid 2-manifold and may need repair!

It is only a warning but I don't like messages in the finished project.
What is the reason for it?

translate ([6.5,2,0]){
     difference (){
     color ("blue")
     cylinder (d=18,h=5);
     color ("red")
     translate ([0,0,-1])
     cylinder (d=15,h=7);
     translate ([-2,-10,-1])
     cube([12,22,7]);
     translate ([-8,-10,-1])
     cube([8,10,7]);
     }
}

translate ([0,0,0]){
         rotate_extrude (angle=360)
         translate ([2.5,5,0])
polygon(points=[[0,0],[0,1],[1.5,1]]);
}




thanks
Lee


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

blade.png (15K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: I don't understand manifold message

OpenSCAD mailing list-2
The "interface" between the lower and upper portions is likely a two-dimensional rendering, a circle. I changed the first translate in the second segment to 0, 0, -0.128 and the error vanished. It won't print well in either circumstance, of course, as there's insufficient material, but I suspect that's not your objective.

On Saturday, February 27, 2021, 5:29:02 PM EST, Lee A <[hidden email]> wrote:


I reduced this to the minimum to show the message.

Each of the two parts will render just fine by themselves. But when I
render them together I get a message;

UI-WARNING: Object may not be a valid 2-manifold and may need repair!

It is only a warning but I don't like messages in the finished project.
What is the reason for it?

translate ([6.5,2,0]){
    difference (){
    color ("blue")
    cylinder (d=18,h=5);
    color ("red")
    translate ([0,0,-1])
    cylinder (d=15,h=7);
    translate ([-2,-10,-1])
    cube([12,22,7]);
    translate ([-8,-10,-1])
    cube([8,10,7]);
    }
}

translate ([0,0,0]){
        rotate_extrude (angle=360)
        translate ([2.5,5,0])
polygon(points=[[0,0],[0,1],[1.5,1]]);
}




thanks
Lee


_______________________________________________
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
|

Re: I don't understand manifold message

Leea
Fred,

Right, there is more material to support the second segment so I thought
not a problem.
I think I now understand why it did that. You gave me the solution.

Lee

On 2/27/2021 4:34 PM, fred via Discuss wrote:

> The "interface" between the lower and upper portions is likely a
> two-dimensional rendering, a circle. I changed the first translate in
> the second segment to 0, 0, -0.128 and the error vanished. It won't
> print well in either circumstance, of course, as there's insufficient
> material, but I suspect that's not your objective.
>
> On Saturday, February 27, 2021, 5:29:02 PM EST, Lee A
> <[hidden email]> wrote:
>
>
> I reduced this to the minimum to show the message.
>
> Each of the two parts will render just fine by themselves. But when I
> render them together I get a message;
>
> UI-WARNING: Object may not be a valid 2-manifold and may need repair!
>
> It is only a warning but I don't like messages in the finished project.
> What is the reason for it?
>
> translate ([6.5,2,0]){
>     difference (){
>     color ("blue")
>     cylinder (d=18,h=5);
>     color ("red")
>     translate ([0,0,-1])
>     cylinder (d=15,h=7);
>     translate ([-2,-10,-1])
>     cube([12,22,7]);
>     translate ([-8,-10,-1])
>     cube([8,10,7]);
>     }
> }
>
> translate ([0,0,0]){
>         rotate_extrude (angle=360)
>         translate ([2.5,5,0])
> polygon(points=[[0,0],[0,1],[1.5,1]]);
> }
>
>
>
>
> thanks
> Lee
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email] <mailto:[hidden email]>
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org 
> <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


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

Re: I don't understand manifold message

JordanBrown
In reply to this post by Leea
[ By the way... if you're starting a new topic, don't reply to an old message and just change the subject line.  Threading mail readers will still see the connection to the existing thread.  Start with a brand new message. ]

Somebody who understands the math better than I do can perhaps explain more accurately, but...

The "not manifold" message means basically that you ended up with two shape sharing the same edge.

The simplest example is this:
cube(10);
translate([10,10,0]) cube(10);

I don't understand why this gives some consumers indigestion, but apparently it does.  (It's claimed that in less trivial examples it makes it ambiguous, or at least difficult, to determine which volumes are inside and outside of the shape.)

Net, always arrange that your models do not share edges.


  


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

Re: best way to create this

OpenSCAD mailing list-2
In reply to this post by Leea
This has been a really interesting discussion with lots of new (to me) ideas presented.

The vagueness of the original request has given lots of scope for comments and ideas.

I hope that some of the suggestions lead to a solution.

Please post your final solution so that we can all see exactly what you were trying to achieve.


Ron


On 2021-02-27 4:10 p.m., Lee A wrote:
It never occurred to me to try scaling a sphere. I suppose with the right scale and then pick the section I want I can get most any curve I want. It would have made my last project easier where I used a really large sphere to make a small shallow dimple. I will play with this, I think I can get what I want.

thanks
Lee

On 2/25/2021 11:36 PM, Ron Wheeler wrote:
Not exactly sure that I understand what you want.

This is another approach where I started with a cylinder and subtracted the bits that I wanted to eliminate.

Perhaps with the right scaling and translating of the circle, you can get the shape that you want.
It will not give you triangles at the edges but will give you a nice concave pocket.

$fn=100;

height=20;
base=30;
difference(){
    cylinder(h=height,r=base);
    union(){
      translate([-100,-50,-9]){cube([100,100,base]);}
      translate([5,10,34]){scale([1,1.5,1]){sphere(r=35);}}
        }
}

If this doesn't quite give you want you want, I hope it gives you some more ideas about how to use difference and the other tools to make something by subtracting shapes.

Ron

On 2021-02-25 11:15 p.m., Lee A wrote:
$fn=100;

height=20;
base=30;

for (i=[0:1:180]){
    rotate ([0,0,-i]){
        translate ([-base-3+(i/10),0,0])
        rotate ([270,0,0]){
            linear_extrude(height = 1, center = false, convexity = 10, twist = 0)
            polygon (points=[[0,0],[0,-height+(i/15)],[base-(i/10),0]]);
        }
    }
}

-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]


-- 
Ron Wheeler
Artifact Software
438-345-3369
[hidden email]

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

Re: I don't understand manifold message

cacb
In reply to this post by JordanBrown
On 2021-02-28 02:46, Jordan Brown wrote:
> Somebody who understands the math better than I do can perhaps explain
> more accurately, but...
>
> The "not manifold" message means basically that you ended up with two
> shape sharing the same edge.

In OpenSCAD and other software based on similar principles, 3d-objects
are described using triangle surface meshes. In other words, objects are
represented as polyhedra with triangular faces (a polyhedron is not
required to have only triangular faces, but that's not a main point
here). In a polyhedron, each face refer to vertices shared with other
faces, and thus they also implicitly share edges with other faces. The
important thing to remember is that for a typical error free polyhedron,
each edge will be shared by exactly 2 faces, i.e. the edge use-count is
2.

Therefore, when something is called "not manifold" it actually means
"not 2-manifold": At least one edge has a use-count different from 2. A
free edge has a use-count of 1 and that's a problem if it is supposed to
be part of of a surface mesh enclosing a solid volume. An edge with a
use count of 3 or more can imply internal faces not part of the surface,
i.e. it has solid material on both sides, and that is understood as a
problem (You could argue that it isn't a problem because such a feature
could be useful in describing an object with different sub-volumes
having different materials, but never mind). It could also imply a free
face with no sold material on either side. You could extend this to more
cases with odd use counts.

But there are also other situations where the edge use count can become
different from 2, the example provided by Jordan Brown is the typical
one: Two cubes positioned so that an edge in cube A coincides with an
edge in cube B. Because they are unioned, cube A and B becomes a single
polyhedron with one shared edge having a use count of 4 (4 faces refer
to it). Still, there is no face with material on both or no sides, all
faces are external as expected. The polyhedron is fine, it just isn't
2-manifold.

The "not manifold" message is therefore not certain to indicate a real
error, but it invites the user to check of something does not look
right.

Carsten Arnholm


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

Re: I don't understand manifold message

adrianv
While correct in some ways, I think that description is a little bit confusing as well.  A manifold as a mathematical object is something which locally looks like Euclidean space.  A  2d manifold or 2-manifold locally looks like a plane, the 2d Euclidean space.  A line on a plane divides the plane into two sides, which is why there must be two faces at an edge.   If there is only one face, or if there are 3 or more, than at that edge the structure doesn't resemble a plane.  The 2 in the term 2-manifold has nothing to do with there being two faces at each edge.   If you join two cubes along an edge then at that joint the structure does not look plane-like, hence it is not a two-dimensional manifold.   CGAL, which OpenSCAD uses for its calculations, requires that all of the objects you construct be 2-manifolds, so if they aren't, you're likely going to have some trouble.   This can happen because an edge has the wrong number of faces (not exactly 2), or because faces intersect each other, or faces are reversed, so edge AB on one face maps to BA on another face.  (This reversal puts a twist into the manifold and actually is mathematically acceptable, but it makes the manifold non-orientable and impossible to embed in 3d space, so it's bad for modeling real world objects.) 

On Sun, Feb 28, 2021 at 4:26 AM <[hidden email]> wrote:
On 2021-02-28 02:46, Jordan Brown wrote:
> Somebody who understands the math better than I do can perhaps explain
> more accurately, but...
>
> The "not manifold" message means basically that you ended up with two
> shape sharing the same edge.

In OpenSCAD and other software based on similar principles, 3d-objects
are described using triangle surface meshes. In other words, objects are
represented as polyhedra with triangular faces (a polyhedron is not
required to have only triangular faces, but that's not a main point
here). In a polyhedron, each face refer to vertices shared with other
faces, and thus they also implicitly share edges with other faces. The
important thing to remember is that for a typical error free polyhedron,
each edge will be shared by exactly 2 faces, i.e. the edge use-count is
2.

Therefore, when something is called "not manifold" it actually means
"not 2-manifold": At least one edge has a use-count different from 2. A
free edge has a use-count of 1 and that's a problem if it is supposed to
be part of of a surface mesh enclosing a solid volume. An edge with a
use count of 3 or more can imply internal faces not part of the surface,
i.e. it has solid material on both sides, and that is understood as a
problem (You could argue that it isn't a problem because such a feature
could be useful in describing an object with different sub-volumes
having different materials, but never mind). It could also imply a free
face with no sold material on either side. You could extend this to more
cases with odd use counts.

But there are also other situations where the edge use count can become
different from 2, the example provided by Jordan Brown is the typical
one: Two cubes positioned so that an edge in cube A coincides with an
edge in cube B. Because they are unioned, cube A and B becomes a single
polyhedron with one shared edge having a use count of 4 (4 faces refer
to it). Still, there is no face with material on both or no sides, all
faces are external as expected. The polyhedron is fine, it just isn't
2-manifold.

The "not manifold" message is therefore not certain to indicate a real
error, but it invites the user to check of something does not look
right.

Carsten Arnholm


_______________________________________________
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
|

Re: I don't understand manifold message

Ronaldo
Just to complement the excellent explanation of @adrianv: when, let's say, two cubes have just one point in common we don't have a 2-manifold because the surface locally doesn't look like a two dimension Euclidean space at that point. That happens for instance when a vertex of one cube is on a vertex, an edge or a face of the other (and only that point in common with it).

Em dom., 28 de fev. de 2021 às 16:45, Adrian Mariano <[hidden email]> escreveu:
While correct in some ways, I think that description is a little bit confusing as well.  A manifold as a mathematical object is something which locally looks like Euclidean space.  A  2d manifold or 2-manifold locally looks like a plane, the 2d Euclidean space.  A line on a plane divides the plane into two sides, which is why there must be two faces at an edge.   If there is only one face, or if there are 3 or more, than at that edge the structure doesn't resemble a plane.  The 2 in the term 2-manifold has nothing to do with there being two faces at each edge.   If you join two cubes along an edge then at that joint the structure does not look plane-like, hence it is not a two-dimensional manifold.   CGAL, which OpenSCAD uses for its calculations, requires that all of the objects you construct be 2-manifolds, so if they aren't, you're likely going to have some trouble.   This can happen because an edge has the wrong number of faces (not exactly 2), or because faces intersect each other, or faces are reversed, so edge AB on one face maps to BA on another face.  (This reversal puts a twist into the manifold and actually is mathematically acceptable, but it makes the manifold non-orientable and impossible to embed in 3d space, so it's bad for modeling real world objects.) 

On Sun, Feb 28, 2021 at 4:26 AM <[hidden email]> wrote:
On 2021-02-28 02:46, Jordan Brown wrote:
> Somebody who understands the math better than I do can perhaps explain
> more accurately, but...
>
> The "not manifold" message means basically that you ended up with two
> shape sharing the same edge.

In OpenSCAD and other software based on similar principles, 3d-objects
are described using triangle surface meshes. In other words, objects are
represented as polyhedra with triangular faces (a polyhedron is not
required to have only triangular faces, but that's not a main point
here). In a polyhedron, each face refer to vertices shared with other
faces, and thus they also implicitly share edges with other faces. The
important thing to remember is that for a typical error free polyhedron,
each edge will be shared by exactly 2 faces, i.e. the edge use-count is
2.

Therefore, when something is called "not manifold" it actually means
"not 2-manifold": At least one edge has a use-count different from 2. A
free edge has a use-count of 1 and that's a problem if it is supposed to
be part of of a surface mesh enclosing a solid volume. An edge with a
use count of 3 or more can imply internal faces not part of the surface,
i.e. it has solid material on both sides, and that is understood as a
problem (You could argue that it isn't a problem because such a feature
could be useful in describing an object with different sub-volumes
having different materials, but never mind). It could also imply a free
face with no sold material on either side. You could extend this to more
cases with odd use counts.

But there are also other situations where the edge use count can become
different from 2, the example provided by Jordan Brown is the typical
one: Two cubes positioned so that an edge in cube A coincides with an
edge in cube B. Because they are unioned, cube A and B becomes a single
polyhedron with one shared edge having a use count of 4 (4 faces refer
to it). Still, there is no face with material on both or no sides, all
faces are external as expected. The polyhedron is fine, it just isn't
2-manifold.

The "not manifold" message is therefore not certain to indicate a real
error, but it invites the user to check of something does not look
right.

Carsten Arnholm


_______________________________________________
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

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