0

Issue in FindAnyPerpendicular

Anonymous 10 years ago 0
This discussion was imported from CodePlex

rys322 wrote at 2012-02-03 16:55:

Objo,

1. First off thank you for all of your hardwork, helixtoolkit is truly amazing.

2. I believe I have found a bug in the FindAnyPerpendicular function of the Vector3DExtensions class. When called by AddTube the function can sometimes bombs out due to the Vector3D n being comprised of very small numbers and so the CrossProduct returns nan. I was able to resolve this issue by adding the line

n.Normalize();

as the first line of the FindAnyPerpendicular function. This does leave n normalized, so it might be better to create a copy of n first and normalize the copy and use that for calculating the crossproduct. 

3. I was also wondering if there is a way to force the a helixviewport to repaint or refresh. I have found that when I make changes and the mouse isn't over the toolkit the changes in my models are not shown until I mouse over the helixviewport.

 

Thanks,

Jordan


objo wrote at 2012-02-05 07:00:

#1: thank you!

#2: thanks for the bug report! See change list 74632. It seems it is not necessary to create a copy of the input vector first. I added some unit tests that also check that the input vector is unchanged.

#3: no there is no repaint/refresh command in HelixViewport3D or System.Windows.Controls.Viewport3D. There should be no need for it. Are you experiencing this with any of the properties of the Visual3D objects in this library? Then check that I have not forgot a property changed callback that updates the underlying model!