Hatch and Fill snippets

Hatch and Fill snippets - Functions for decorating area between two functions in 2d plots - Сообщения

#21 Опубликовано: 07.06.2016 12:41:34
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 Опубликовано: 07.06.2016 12:49:32
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 Опубликовано: 07.06.2016 23:00:19
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: 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 Опубликовано: 08.06.2016 04:23:10
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 КиБ) скачан 80 раз(а).
FillRnd_0.97_matrix.sm (44 КиБ) скачан 77 раз(а).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#25 Опубликовано: 08.06.2016 12:25:30
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 Опубликовано: 08.06.2016 13:23:38
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 Опубликовано: 08.06.2016 14:49:23
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: 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 Опубликовано: 08.06.2016 21:12:25
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 81 раз(а).
#29 Опубликовано: 28.03.2017 14:06:57
Alexander O. Melnik

Alexander O. Melnik

127 сообщений из 494 понравились пользователям.

Группа: Moderator

In regards to hatch and fill - do we have a Smath code that can hatch a closed polygon?
#30 Опубликовано: 28.03.2017 15:47:17
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 Опубликовано: 29.03.2017 08:59:12
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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

Файл не найден.Файл не найден.

#32 Опубликовано: 29.03.2017 09:19:49
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 КиБ) скачан 67 раз(а).
#33 Опубликовано: 29.03.2017 09:58:50
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: 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 КиБ) скачан 101 раз(а).

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 пользователям понравился этот пост
Alexander O. Melnik 12.04.2017 11:49:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений