nortikin / sverchok

Sverchok
http://nortikin.github.io/sverchok/
GNU General Public License v3.0
2.25k stars 233 forks source link

Projection_Decomposition.json #4239

Open Durman opened 3 years ago

Durman commented 3 years ago

Problem statement

Examples -> Fields -> Projection_Decomposition

Some return values of the Apply vector field node are Nan. And also there is the warning:

2021-07-23 14:36:07,064 [WARNING] py.warnings: D:\Серегй\ЯндексДиск\3.Свои_проекты\Blender_code\addons\sverchok\utils\field\vector.py:753: RuntimeWarning: invalid value encountered in true_divide
  projection = np.dot(v1, v2) * v2 / np.dot(v2, v2)
zeffii commented 3 years ago

it's a pitty that in that case the warning is now disassociated with the Node where the warning arises.

satabol commented 1 year ago

Hi @Durman . I test now and no warning message in console about node "Apply vector field":

image Example Fields Projection Decomposition anim

Durman commented 1 year ago

This is given to me be the second Apply Field node. image

satabol commented 1 year ago

It is very strange. I do not see any messages in console: image

What params print your message?

Durman commented 1 year ago

I just used the Debug node to print socket output in console because it's too large to print the whole output with Stethoscope node.

satabol commented 1 year ago

I found place where it happens:

https://github.com/nortikin/sverchok/blob/e0f300e27cf98dc8ba80d353420458c432bbab02/utils/field/vector.py#L735-L737

and:

https://github.com/nortikin/sverchok/blob/e0f300e27cf98dc8ba80d353420458c432bbab02/utils/field/vector.py#L761-L764

if V2=(0,0,0) then /np.dot(v2,v2) is zero but there is disallowed to divide with zero. I understand that this is not correct solution for this case but we talked this with Illia Portnov and did not find a correct solution for a while. Field are lines (and curves) but current solution do not see them as lines. So I think this is a feature of the current solution. If you look solution for current case I have o proposal to set divz=5 for a 'Box' node: image

But any case I found other cases with glitches:

image

image

I have no idea what to do in this case.