Hatch and Fill snippets

Hatch and Fill snippets - Functions for decorating area between two functions in 2d plots - Messages

#21 Posted: 6/7/2016 12:41:34 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Thanks Alvaro.

I love this one variable in the XY directions.
I didn't understand your "lele" function [does not work in Smath 5346].
I think it's not posible to hatch a closed shape unless in two parts like some circle definitions.
You can rescue like in the example filling random the partially filled reservoir [posted few days ago].

Jean
#22 Posted: 6/7/2016 12:49:32 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

Well, works fine in last nightly build, but you're right, in others don't. I try to modify, but have a lot of issues. For instance, attached seems to work in last portable version, but can take a very long time for fill(phi(2), ...) , I suspect for some problem with the lele function


Nice work. lele from CustomFunctions is just a wrapper for booleans, nothing special behind. The problem probably is simply that you are using chained assignments inside matrices, that is an official feature only since one of the 0.98 relases, previously you have to reverse the order of the assignments inside the matrices or use a line.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#23 Posted: 6/7/2016 11:00:19 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Wrote

[lele from CustomFunctions is just a wrapper for booleans, nothing special behind. The problem probably is simply that you are using chained assignments inside matrices, that is an official feature only since one of the 0.98 relases, previously you have to reverse the order of the assignments inside the matrices or use a line.



Hi Davide. The problem with lele whas related about the parenthesis, not the funciton by itself: sm file saved with the newest nightly version is opened with some troubles in portable version, based in an older version. Also ask to actuallize "math regions plugins", but, obviously the list of plugins is empty. So, probably was not a CustomFunction back compatibility issue, but maybe a SMath one, related with something new in "math region".

What was frustating to me was my inhability to calculate Dy inside the loop, with something like D := max(stack(Dy,abs(F[k-G[k))) (or with Max and withou stack), because times of those arranges (if don't report errors) are up of 3 minutes.

In others attemps, with matrix predimentionation (including R as Nx*Ny by 5, and taking submatrix at the end, from 1 to N-1) taking also times ridicoulous. And offuscate the code, because need to take a new line for each matrix, or prolongate too much to the left the function, just because can use predefined values to the left in matrices (i.e. X = matrix, then F = X, G = X, etc.)

Best regards.

Alvaro.
#24 Posted: 6/8/2016 4:23:10 AM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hi Alvaro,

I guess you are right about parenthesis; I see a problem in φ(x,y) and h(x,y), that are completely messed up (also for these function you cannot copy/paste the whole RHS content from newer to older).

SMath is back compatible, in the sense that in general you can open & run correctly stuff made with older program versions, but the opposite is not guarantee (you can open the worksheet, but it may doesn't run properly; this approach was enforced with the time. In fact since 0.97.5737 when you try to open the worksheet you are warned three times, a first form warn you that the worksheet was made with a newer program version, and the extensions manager is prompted to ask you to update the libraries, but as for now core libraries are not available for such task -> a third form reports that non all the dependancies are resolved; I guess that after this you may expect that something shouldn't run as designed).

I think that as for now (meaning: up to there isn't a way to update the core libraries) if you want to provide something that may works for a wide range of versions, you have to build it with an older program version.

Attached your worksheet "downgraded" to 0.97;
notice that the version that uses line is cross compatible (0.97/0.98) but is much slower even in latest versions (in SMath 0.98, line version runs in 28-30" against 6-7" of your based on matrices), while the version that uses matrices can't be executed correctly in 0.98.

FillRnd_0.97+0.98_line.sm (44 KiB) downloaded 114 time(s).
FillRnd_0.97_matrix.sm (44 KiB) downloaded 102 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#25 Posted: 6/8/2016 12:25:30 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Davide, Alvaro,

I noticed your double integral; the way you write it in the version you are using,
is it supposed to produce result ? example: f(x,y):=e^x *(0.5-y^3)

Jean
#26 Posted: 6/8/2016 1:23:38 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Hello Jean,

nope, it doesn't works for me too...
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#27 Posted: 6/8/2016 2:49:23 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Wrote

Hello Jean,

nope, it doesn't works for me too...



Hi. It's just a remember to further use rows (and maybe not only the number) for montecarlo estimating the area. It's not expected to work, even it was desiderable.

Best regards.

Alvaro.
#28 Posted: 6/8/2016 9:12:25 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Hello: Alvaro, Davide

My understanding of what you are trying to do is only
slightly pregnant. Here an attempt to double integral.

Jean

Maths Double Triple Integal.sm (24 KiB) downloaded 113 time(s).
#29 Posted: 3/28/2017 2:06:57 PM
Alexander O. Melnik

Alexander O. Melnik

127 likes in 494 posts.

Group: Moderator

In regards to hatch and fill - do we have a Smath code that can hatch a closed polygon?
#30 Posted: 3/28/2017 3:47:17 PM
Davide Carpi

Davide Carpi

1417 likes in 2873 posts.

Group: Moderator

Wrote

In regards to hatch and fill - do we have a Smath code that can hatch a closed polygon?



this might help?
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#31 Posted: 3/29/2017 8:59:12 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Hello Alex,

Wrote

In regards to hatch and fill - do we have a Smath code that can hatch a closed polygon?



We don't have it yet for the closed polygon.
We can fill "Stem style" and "Radial stem" [pie chart RemToDo].
If you have a polygon from foreign image: you must first digitize
to get a set of coordinates then fill "Stem style". If your polygon
depends upon some line junction: just a matter of discretizing
within the conditional junctions and plot "Stem style".

Jean

File not found.File not found.

#32 Posted: 3/29/2017 9:19:49 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

... experiment this simple digitizer.
You must first capture the image, save BMP in your system
then read back ... done ... next fill "Stem style".
That will do for your polygon from "Autocad created image".

Jean

Digitize.sm (52 KiB) downloaded 99 time(s).
#33 Posted: 3/29/2017 9:58:50 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Wrote

In regards to hatch and fill - do we have a Smath code that can hatch a closed polygon?



Try the gpc wrapper plugin by davide

GPC.sm (6 KiB) downloaded 138 time(s).

2017-03-29 14_54_45-SMath Studio 0.98.6179 - [Blatt1_].png
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Alexander O. Melnik 4/12/2017 11:49:00 AM
  • New Posts New Posts
  • No New Posts No New Posts