Two annoyances

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

Re: Two annoyances

jon_bondy
Peter:

Apologies.  I read your code more thoroughly, and it does do the difference() that I require.  And it has the shapes consistently normal. So, best of both worlds.

Jon

On 7/2/2015 9:24 AM, jon wrote:
Peter:

As much as I appreciate your approach, it turned out that I needed the approach that subtracted an InnerHorn from the InnerHorn, in order to clean up some other geometry (punching a hole through the base/stand).  I suppose I can try to meld your normals and Michael's cylinders...

Jon

On 7/2/2015 6:18 AM, Peter Falke wrote:
With my program the shapes are always placed normal to the path.
Just give me the math you used for the path.


2015-07-02 5:00 GMT+02:00 MichaelAtOz <[hidden email]>:
jon_bondy wrote
> After I press F5, the Console says that it has completed the computation
> in under a second, but it takes about 5 seconds for the rendering to
> take place.  This is mildly annoying, but what is really annoying is
> that for the next minute or so, the cursor alters between normal and
> hourglass every 5 or 10 seconds.  It is as if it thinks I asked for an
> adjustment in the rendered view, but I have not.  Given how long the
> rendering takes, this is very time consuming.

Yeh, I had noted that too, very annoying. I suspect the refresh is under Qt
control.
You need to keep you mouse cursor out of the display window.
That is the display driver latency when a high poly count AFAIK.


> I got cute, and had the horns go up and then down.  This is the result.
> Any hints about how to orient the cylinders so that they are normal to
> the path?

No sorry, I would have to redo my high school maths, that makes my brain
hurt...



-----
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
--
View this message in context: http://forum.openscad.org/Two-annoyances-tp12935p12974.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



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!


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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6037 / Virus Database: 4365/10143 - Release Date: 07/02/15




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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6037 / Virus Database: 4365/10145 - Release Date: 07/02/15



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

Re: Two annoyances

jon_bondy
In reply to this post by MichaelAtOz
I have been keeping my cursor out of the display window, but even so,
the thing redraws perhaps 5 times before anything useful appears.  So I
sit there for 2-3 minutes waiting for the display to appear.  If I click
on the icon to display the full object, that takes another 2-3 minutes
of repeated displays.

Something is really wrong.  I mean, other than the fact that my
particular model has a lot of triangles.

Jon

On 7/1/2015 11:00 PM, MichaelAtOz wrote:

> jon_bondy wrote
>> After I press F5, the Console says that it has completed the computation
>> in under a second, but it takes about 5 seconds for the rendering to
>> take place.  This is mildly annoying, but what is really annoying is
>> that for the next minute or so, the cursor alters between normal and
>> hourglass every 5 or 10 seconds.  It is as if it thinks I asked for an
>> adjustment in the rendered view, but I have not.  Given how long the
>> rendering takes, this is very time consuming.
> Yeh, I had noted that too, very annoying. I suspect the refresh is under Qt
> control.
> You need to keep you mouse cursor out of the display window.
> That is the display driver latency when a high poly count AFAIK.
>
>
>> I got cute, and had the horns go up and then down.  This is the result.
>> Any hints about how to orient the cylinders so that they are normal to
>> the path?
> No sorry, I would have to redo my high school maths, that makes my brain
> hurt...
>
>
>
> -----
> Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
> --
> View this message in context: http://forum.openscad.org/Two-annoyances-tp12935p12974.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
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2015.0.6037 / Virus Database: 4365/10140 - Release Date: 07/01/15


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

Re: Two annoyances

Peter Falke
Why do you want so many triangles, anyway?
What is the resolution you need in the end?



I dont have your code, but it looks to me, that you just union a lot of cylinders together. That always be slow.
If you would use a chain hull algorithm, you can use much less cylinders and still get a smooth surface.
You just cant brute force everything in OpenScad.
You also may have a lock at the sweep algorithm, that is super fast for these things.
https://github.com/openscad/list-comprehension-demos

Share your code and we can give you some pointers.



2015-07-03 0:11 GMT+02:00 jon <[hidden email]>:
I have been keeping my cursor out of the display window, but even so, the thing redraws perhaps 5 times before anything useful appears.  So I sit there for 2-3 minutes waiting for the display to appear.  If I click on the icon to display the full object, that takes another 2-3 minutes of repeated displays.

Something is really wrong.  I mean, other than the fact that my particular model has a lot of triangles.

Jon


On 7/1/2015 11:00 PM, MichaelAtOz wrote:
jon_bondy wrote
After I press F5, the Console says that it has completed the computation
in under a second, but it takes about 5 seconds for the rendering to
take place.  This is mildly annoying, but what is really annoying is
that for the next minute or so, the cursor alters between normal and
hourglass every 5 or 10 seconds.  It is as if it thinks I asked for an
adjustment in the rendered view, but I have not.  Given how long the
rendering takes, this is very time consuming.
Yeh, I had noted that too, very annoying. I suspect the refresh is under Qt
control.
You need to keep you mouse cursor out of the display window.
That is the display driver latency when a high poly count AFAIK.


I got cute, and had the horns go up and then down.  This is the result.
Any hints about how to orient the cylinders so that they are normal to
the path?
No sorry, I would have to redo my high school maths, that makes my brain
hurt...



-----
Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
--
View this message in context: http://forum.openscad.org/Two-annoyances-tp12935p12974.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


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6037 / Virus Database: 4365/10140 - Release Date: 07/01/15


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



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

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

sweep

jon_bondy
I think that one reason I avoid Sweep is because there is no documentation that I can find, and the code has no comments at all.  It may be obvious to some of you, but not to me.  It is pure majick.

For example, in sweep-path, a function f() is defined, which appears to define a path through 3D space.  Fine.  Why does the shape rotate as it is swept out?  What is controlling that?

I guess that the shape() is 2D (because it only has pairs of coordinates) but it is not in any format that I know about (no triangles, no faces).  How does it work?   

Does it really have to be so obscure?

Jon

On 7/2/2015 7:10 PM, Peter Falke wrote:
Why do you want so many triangles, anyway?
What is the resolution you need in the end?



I dont have your code, but it looks to me, that you just union a lot of cylinders together. That always be slow.
If you would use a chain hull algorithm, you can use much less cylinders and still get a smooth surface.
You just cant brute force everything in OpenScad.
You also may have a lock at the sweep algorithm, that is super fast for these things.
https://github.com/openscad/list-comprehension-demos

Share your code and we can give you some pointers.


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

Re: sweep

jon_bondy
Crickets?  Really?

On 7/4/2015 3:17 PM, jon wrote:
I think that one reason I avoid Sweep is because there is no documentation that I can find, and the code has no comments at all.  It may be obvious to some of you, but not to me.  It is pure majick.

For example, in sweep-path, a function f() is defined, which appears to define a path through 3D space.  Fine.  Why does the shape rotate as it is swept out?  What is controlling that?

I guess that the shape() is 2D (because it only has pairs of coordinates) but it is not in any format that I know about (no triangles, no faces).  How does it work?   

Does it really have to be so obscure?

Jon

On 7/2/2015 7:10 PM, Peter Falke wrote:
Why do you want so many triangles, anyway?
What is the resolution you need in the end?



I dont have your code, but it looks to me, that you just union a lot of cylinders together. That always be slow.
If you would use a chain hull algorithm, you can use much less cylinders and still get a smooth surface.
You just cant brute force everything in OpenScad.
You also may have a lock at the sweep algorithm, that is super fast for these things.
https://github.com/openscad/list-comprehension-demos

Share your code and we can give you some pointers.



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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2015.0.6037 / Virus Database: 4365/10159 - Release Date: 07/04/15



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

Re: sweep

MichaelAtOz
Administrator
>  there is no documentation

It is a user space function, not part of OpenSCAD. Hopefully the author may be listening...

> It may be obvious to some of you

No, generally over my head, I have to look at it carefully.

> in sweep-path, a function f() is defined, which appears to define a path through 3D space.
> Why does the shape rotate as it is swept out?

Got me. I suspect tangent_path() is involved.

> I guess that the shape() is 2D (because it only has pairs of coordinates) but it is not in any format that I know about (no triangles, no faces).  How does it work?

Yes it is a 2D shape. Note line 36 `shape3d = to_3d(shape);` in sweep.scad - I have not looked at to_3D yet.

But note polygon just takes a list of points, path is optional if the points are in order.

> Does it really have to be so obscure?

I suppose it could use some comments, but it is user content. So enjoy what you have ??
Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|

Re: sweep

jon_bondy
Michael:

Thanks for trying.  Glad I'm not the only one who does not understand
everything!

Jon

On 7/8/2015 6:02 PM, MichaelAtOz wrote:

>>   there is no documentation
> It is a user space function, not part of OpenSCAD. Hopefully the author may
> be listening...
>
>> It may be obvious to some of you
> No, generally over my head, I have to look at it carefully.
>
>> in sweep-path, a function f() is defined, which appears to define a path
>> through 3D space.
>> Why does the shape rotate as it is swept out?
> Got me. I suspect tangent_path() is involved.
>
>> I guess that the shape() is 2D (because it only has pairs of coordinates)
>> but it is not in any format that I know about (no triangles, no faces).
>> How does it work?
> Yes it is a 2D shape. Note line 36 `shape3d = to_3d(shape);` in sweep.scad -
> I have not looked at to_3D yet.
>
> But note polygon just takes a list of points, path is optional if the points
> are in order.
>
>> Does it really have to be so obscure?
> I suppose it could use some comments, but it is user content. So enjoy what
> you have ??
>
>
>
> -----
> Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/
> --
> View this message in context: http://forum.openscad.org/Two-annoyances-tp12935p13100.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
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2015.0.6081 / Virus Database: 4392/10188 - Release Date: 07/08/15


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

Re: Sweep

David Eccles (gringer)
In reply to this post by jon_bondy
>> in sweep-path, a function f() is defined, which appears to define a path
>> through 3D space. Why does the shape rotate as it is swept out?
>
> Got me. I suspect tangent_path() is involved.

I've had this problem myself when trying to make my own path extrude
function:

http://www.thingiverse.com/thing:186660

The problem is that the manipulations you make to rotate the 2D object
around in 3D space will frequently also induce a rotation of the object.
It's not immediately obvious how to alter the initial rotation of the
object to get it to have the least amount of warping when extruding a
path.

When I've tried to have a look at the issue further, I get the feeling
that this rotation is dependent on prior and future states. In other
words, it's context sensitive; it doesn't seem possible to determine the
best initial rotation given just a start state and a position in 3D space.

 - David


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

Re: Sweep

runsun
This post was updated on .
About the issue of twisting during sweeping:

The way I approach this is not to calc points independently, but calc them by projecting points of previous frame onto the plane at the current point.

Approaches:

1) Calc angle-bisect Point, Pb:

For each point i, P(i), we have a pqr= [ P(i-1), P(i), P(i+1) ] and the angle A(i) of P(i). Calc the angle bisect point Pb using pqr, such that line [ P(i), Pb ] divides A(i) equally;

2) Make the projection plane at i:

Calc the point N such that line [ P(i),N ] is the normal of [ P(i-1), P(i), Pb ]. The plane, S=[ P(i), N, Pb ], the plane that cuts angle A(i) in half, will be the target plane to which we project previous frame.

3) Projection:

Retrieve points from the previous frame and project them along the line [ P(i-1), P(i) ] onto S.

Thus, we will have an array Fs= [ frame0, frame1, frame2 ...]

4) Join frames together to make it: pts= [ P0, P1, P2 ...]

5) Generate faces using the faces() function described in faces:

f=faces( "chain", nside= len(Fs[0]), nseg= len(Fs)-1 );

6) And simply, polyhedron( points=pts, faces=f );

So far it seems to work well. Throwing in any random 3D line and it can produce sweeping nicely without the problem of twisting.

In fact, you can actually apply the twisting of your choice, by modifying steps of projection.

The following is the "chain" example on my post about faces:

chain

Or I can generate more examples if interested.
$ Runsun Pan, PhD
$ libs: scadx, doctest, faces(git), offline doc(git), runscad.py(2,git), editor of choice: CudaText ( OpenSCAD lexer); $ Tips; $ Snippets
Reply | Threaded
Open this post in threaded view
|

Re: sweep

kintel
Administrator
In reply to this post by jon_bondy
On Jul 4, 2015, at 21:17 PM, jon <[hidden email]> wrote:

> I think that one reason I avoid Sweep is because there is no documentation that I can find, and the code has no comments at all.  It may be obvious to some of you, but not to me.  It is pure majick.
>
sweep() is merely an experiment/demo to help figure out how a built-in sweep function should look like. It was hacked together mostly by Oskar Linde, and packaged into the demo repository by me.
It’s made public so that people can play with it and people who are interested in digging deep can do so.

 -Marius



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