NVil Forum

General Category => Bug Reports => Topic started by: steve on June 28, 2014, 01:42:44 pm

Title: Spline Tangents on "line list"
Post by: steve on June 28, 2014, 01:42:44 pm
Hi IStonia,

This is a problem I have seen for a long time, but usually attempt to work around the issue, but due to forum post concerning this, I thought it time to report.

Quick, simple example.

There are various times when objects, such as bolts/rivet heads, need to be placed along an object. The easiest way should be to create a path(spline) and use the "Instance > Array > Spline"

So here is an object, I have created an inset to define the path/placement for the objects(edge highlighted).

(http://i.imgur.com/wcuullc.jpg)

I use "Create Closed Spline" to create the spline(path) from the selected edges. Change the spline(path) to a "Line List"(as I want it to follow the sharp corners), then use the "Instance > Array > Spline" to create the objects(I am using an object shaped as a 3d arrow so you can see the direction of each object)
(http://i.imgur.com/idKwaaK.jpg)
As you can see from the result, the direction of the objects(normal directions) change/flip by 90/180 degrees along the spline(path). The only way to attempt to fix the issue is by changing back to a "naturalize" spline, then spend time editing the tangents to vectors (cusp tangents making alignments to previous/next vertex), and then spending more time using "Tangent Twist" to rotate the normals to correct orientation. That is not really workable when you have a spline with many segments.

Could you please take a look at this issue when you can find time?

Thanks.



-----------------------------------------

To add:-

If I go back to "Voidworld jul-10-12". in that build it was a simple matter of creating the "line list" spline and using "array" without all the need for a lot of manual editing.

(http://i.imgur.com/sjoyKnH.jpg)





Title: Re: Spline Tangents on "line list"
Post by: JTenebrous on June 30, 2014, 10:28:19 am
+1 to this, for sure.  To use Steve's exact  example, I'm constantly adding bolts/rivet heads to models (I usually do this in CAD software at the moment)... so having the spline vectors working correctly on paths created from an inset, etc. would be very useful in NVIL.
Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 03, 2014, 09:17:46 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-03-14.rar

Also I've made it possible to modify tangent flow in "Tangent" tool while the spline is in linelist style.
Title: Re: Spline Tangents on "line list"
Post by: steve on July 03, 2014, 02:58:37 pm
Hi IStonia,

The conversion to line_list appears to of improved. But it does not get around an issue that I have put forward various times before, which is the initial creation of the splines normal directions/tangent vectors.

To expand slightly on the above example.

Here is the simple model from above example, apart from me adding 2 extra edge loops, which will add 4 extra vertex to the created spline, but this time, the distance between the spline vertex are not evenly spaced.

Model with edge selection:-
(http://i.imgur.com/kQRYtXB.jpg)

Created spline from edge (you can see a problem top right)
(http://i.imgur.com/nKsMzlK.jpg)

Zoom to that problem area, and you can see the spline is looping back on itself. That problem may not be seen by user and simply change the spline to line_list.
(http://i.imgur.com/WJldrTQ.jpg)

As line_list spline, use the "array> spline" to array object, and result would not be as wanted/expected.
(http://i.imgur.com/J9QOAsK.jpg)

Of course now you could start to edit the normal twist direction of the line_list vertex, but again if the spline as many vertex it could take quite a while, but you also have the added problem of not knowing what angle the spline_vertex_normals direction actually are, and a need to start aligning by eye, as there is no value given as to what the normal direction is, and no tools/functions to set the normal direction to a specific object/world angle.
Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 04, 2014, 10:32:50 am
try this
http://www.digitalfossils.com/Download/NVil-Jul-04-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on July 04, 2014, 06:39:44 pm
Hi IStonia,

Certainly an improvement.

The main problem now appears to be coming from the automatic creation of closed splines, or, where you manually start the creation of the spline.

As example:-

I have an object and want to add rivet heads along the 4 edge loops shown.
(http://i.imgur.com/DPOEEG5.jpg)

Of course, I could create one spline from one edge loop, then copy the created array(from spline) to the other 3 edge loops, however, the resulting normal directions of the created splines differs depending on which edge loop I used, as the start/direction of the spline changes (possibly due to underlying vertex order/numbering).
The 4 splines as line_list
(http://i.imgur.com/UfobKIu.jpg)

With that example, 2 splines give good usable result(all normal directions as expected), and 2 splines give normals that flip normals direction(not usable).

I could post images of the resulting spline arrays, but I do not see the point, it would be better for you to check yourself. I have attached the simple example geometry.



Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 04, 2014, 09:31:44 pm
Try this
http://www.digitalfossils.com/Download/NVil-Jul-05-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on July 04, 2014, 10:38:57 pm
Hi IStonia,

Up to now, all testing is giving usable results, with spline vertex normals consistent. Excellent work.

The calculations you are using to create the asymmetric tangents, will those now be used for all naturalized spline calculations?, as the result are far better with that.

Many thanks for taking the time to look at and fix this issue.

Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 05, 2014, 11:24:15 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-06-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on July 05, 2014, 02:04:20 pm
Hi IStonia,

On first quick checks,

If using "Edit > options > Spline transform options > Auto Naturalize Selected Points" or "SplineVertex Shortcut tools > Naturalize Spine selected",  unselected spline vertex on each side of the selected spline vertex are also naturalized when moving selected vertex with manipulator.(that did not happen previously).

If using scale manipulator to flatten spline vertex, the movement(scaling) of the vertex is very choppy(not smooth). Probably due to new calculations for auto naturalize.(not a major problem).

I will check/test more later today.

Thanks,

Title: Re: Spline Tangents on "line list"
Post by: steve on July 05, 2014, 03:33:50 pm
"Bridge holes > Curved" is causing Nvil to crash. (win7 -64)

(Note: It actually looks like the problem is due to the creation of a 2 point(vertex) spline. Creating simple 2 vertex spline also causes same crash/report. So unable to make checks/tests on various functions that require 2 vertex spline)

Windows error report:-

Code: [Select]
Problem signature:
  Problem Event Name: CLR20r3
  Problem Signature 01: nvil 1.0.exe
  Problem Signature 02: 2.3.5300.536
  Problem Signature 03: 53b7dee1
  Problem Signature 04: CharacterClasses
  Problem Signature 05: 2.3.5300.521
  Problem Signature 06: 53b7dec3
  Problem Signature 07: 463
  Problem Signature 08: 0
  Problem Signature 09: System.StackOverflowException
  OS Version: 6.1.7600.2.0.0.256.1
  Locale ID: 2057
Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 06, 2014, 09:21:22 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-07-14.rar

Also a new option
Edit > options > Spline transform Options > Auto Naturalize Selected Point's Adj Points Too. Auto naturalize at selected point's adjacent points too on spline vertex transforming.
Title: Re: Spline Tangents on "line list"
Post by: steve on July 06, 2014, 11:20:09 am
Hi IStonia,

On quick tests, all issues reported on thread have been fixed.

This:-
Also a new option
Edit > options > Spline transform Options > Auto Naturalize Selected Point's Adj Points Too. Auto naturalize at selected point's adjacent points too on spline vertex transforming.
I do not see functioning.
It appears that function works in conjunction with "Auto Naturalize Selected Points". IMHO, the naming/use of that new function could lead to confusion (certainly did with me).
Would it not be possible to make that new function work so it actually auto naturalize the adj to selected(without the need for "Auto Naturalize selected" to be enabled)? If not, then that function should really be grayed out until the "Auto Naturalize Selected Points" is enabled. But of course, that can also cause issue, due to the fact when you select an option from one of the drop down menus, the menu automatically closes.

---------------------------
Note:
When testing splines > Line_list conversion, I have been testing with known limitation due to underlying twist method >Tangent calculations. So it is certainly possible for users to get unexpected results.
I think the only way to get line_list splines correct from any/all geometry, would be for Nvil to copy the vertex normal direction information from geometry and use that for spline_tangent direction.


Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 12, 2014, 08:02:58 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-12-14.rar

*  Edit > options > Spline transform Options > Auto Naturalize Selected Points And Adj Points. Auto naturalize at selected points and adjacent points as well on spline vertex transforming.
*  "Affect all selected points" option is added to Tangent > Twist tool.

Note:
When testing splines > Line_list conversion, I have been testing with known limitation due to underlying twist method >Tangent calculations. So it is certainly possible for users to get unexpected results.
I think the only way to get line_list splines correct from any/all geometry, would be for Nvil to copy the vertex normal direction information from geometry and use that for spline_tangent direction.

Not sure what you mean. Can you give illustration pictures?
Title: Re: Spline Tangents on "line list"
Post by: steve on July 12, 2014, 01:37:49 pm
Hi IStonia,

Not sure what you mean. Can you give illustration pictures?

Currently, when you create a spline from edges, the spline is created from the vertex positions of the selection, but the normal directions of the spline vertex are based on what?

If I put forward another example of wanting to place rivets around an object, an object that is not as planer as the examples shown before. For example, a sphere.

Here I have a sphere(wire_frame), with an edge selection for the positioning of the rivets.

(http://i.imgur.com/zmQx5V4.jpg)

Create closed spline from selection.(changed to line_list)
(http://i.imgur.com/7DljA0l.jpg)

Here I have created an instance array using that spline, with option "Snap points > Use spline points"

(http://i.imgur.com/VMtHugM.jpg)
You can see from the result, the arrayed objects flip, and if shown with object(sphere), it is not usable, and as mentioned, there is no way to quickly/accurately make alignment of spline vertex normals to object normals.
(http://i.imgur.com/xaZoDbO.jpg)

Change array option to "Snap points > Use Input", and the result is better, as at least the arrayed object point in similar direction, but still not correct for the usage wanted. At best, only 7 out of 24 instances point in correct(usable) normal direction

(http://i.imgur.com/Wmm7J4x.jpg)

Now of course, as mentioned, the user could try and manually edit the spline, but would probably give up on a spline with many vertex, due to the fact alignment would need to be made by eye, as there are no tools/functions that will align the spline vertex normals to a target.
Of course, you could now sit down and make new algorithms to try and get around the issue shown in this example, but would any new algorithm work for ever possible situation?
So rather than the user fighting with this, or you possibly pulling you hair out trying different algorithms, why not have an option/function that will create the splines(from geometry) based on the underlying geometry vertex positions and normal directions?
That would save the user possibly a lot of work, and save you keep trying to make adjustments to algorithms based on more examples I could post, showing how the new algorithms do not work in a different example.

---------------------------
With Nvil, there are various, quite advanced tools/function where splines are used, but actually creating splines can be a complete PITA




Title: Re: Spline Tangents on "line list"
Post by: steve on July 13, 2014, 06:27:40 pm
Another major point with this issue. With the options to disable "Auto Naturalize", why is it that the flow/tangent directions(of spline vertex) still changes regardless of setting the options to disable auto naturalize?

I can spend quite a lot of time setting up a path with correct flow/tangents, but if I move even slightly a spline vertex with all "Auto naturalize" disabled, the flow/tangents of the spline vertex just change/flips to whatever it wants to.
Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 18, 2014, 08:07:06 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-18-14.rar

If a spline bitangent is twisted, the bitangent will be fixed so the program won't perform auto operation on it.
A new button "Set As Twisted" is added to Tangent tool. It makes it possible to set bitangent state without twisted.
If a spline vertex is created from vertex/edge/polygon, the mesh normal of that point will be used to set the spline vertex's bitagent.
Title: Re: Spline Tangents on "line list"
Post by: steve on July 18, 2014, 04:14:44 pm
Hi IStonia,

Try this
Giving more consistent results, but only on contiguous edge selections for the "[edge tools] Create spline".


Quote
If a spline bitangent is twisted, the bitangent will be fixed so the program won't perform auto operation on it.
A new button "Set As Twisted" is added to Tangent tool. It makes it possible to set bitangent state without twisted.
Would a better description for that (for the end user) not be "Lock Flow" or "Lock Tangent flow"?
Having an option "Set as twisted" is, IMHO for an end user, ambiguous.


Quote
If a spline vertex is created from vertex/edge/polygon, the mesh normal of that point will be used to set the spline vertex's bitagent.
With your description, I was expected that when manually creating a spline using geometry snap points, that the spline vertex normal direction would be created from that underlying geometry, but that does not appear to be the case, or at least, not all the time.

I will take some screen shots of examples and post them when done.

Title: Re: Spline Tangents on "line list"
Post by: steve on July 18, 2014, 05:45:01 pm
Hi IStonia,

Simple example:-

I have a face loop from a sphere(rest of sphere deleted), have added an edge loop, from which I want to create a spline that is created with its vertex normals the same as the underlying geometry.

(http://i.imgur.com/j4w33Ut.jpg)

With that [contiguous] edge loop selected, using the "Edge tools> Create closed spline", the result is as what is wanted (as expected from new implementation). To show results, I have added an "Instance > Spline Array" using that created spline.

(http://i.imgur.com/NpZNzWk.jpg)
I have performed testing on different geometry, and the result are good, I cannot fault that at the moment, when using a contiguous edge selection with the "edge tools > Create closed spline" as shown above

I am seeing problems from manually creating the spline from snap points. The reason I am making such tests and posting the problem is that you specifically stated:-
Quote
If a spline vertex is created from vertex/edge/polygon, the mesh normal of that point will be used to set the spline vertex's bitagent.
and as the only tools available to create a spline from vertex or faces is via the manual spline creation method via snap points, I am testing that method.

Here I created a closed spline using the visual tools "Spline" using the vertex snaps of the above edge selection.
The results are not as expected(again, an instance array as been added to show results)
(http://i.imgur.com/ZdBXvR4.jpg)

I also see problems if a preselected edges are not contiguous, for the "Edge tools > Create spline".

Same example as above, but with only 4 edge preselected, then "Edge tools > Create closed spline" used:-

(http://i.imgur.com/9G74fvC.jpg)
If you look at the spline vertex normals, you will see they are not correct to underlying geometry normals.

If you need more info or examples, I can post them.






Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 19, 2014, 10:52:06 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-19-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on July 19, 2014, 02:22:41 pm
Hi IStonia,

On initial testing:-

The use of "Edge tools > Create spline" on contiguous or non-contiguous edge selections is now producing spline with vertex normals from underlying geometry. Also, manually creating smooth splines to snap points is giving correct results. (Although I am not convinced the breaking of the relationship(tangency) between the flow tangent and tangent handles is good to do. But that may be the only way to make implementation?)

Where I am seeing issues, is with "Line list" splines.

Simple example.

Again, using a face loop from a sphere with edge loop added:-

"Edge tools > Create closed spline" and OK

(http://i.imgur.com/UfYSD7v.jpg)

Looking from Top view, the tangency of the flow is correct to the circular shape of the spline.

(http://i.imgur.com/sZePRB3.jpg)

If I now change the spline to "Line list"(or if I had created a "line list" spline from snap points), the result is not usable, as the normal direction of the flow on the straight segments of the spline are not tangent to the spline.

(http://i.imgur.com/hKRPABw.jpg)

Here I add a spline array to show problem more clearly:-

(http://i.imgur.com/7nP2KOe.jpg)

Also, if I change the spacing of the array to "Random", some of the arrayed objects flip 180 deg:-

(http://i.imgur.com/b4lurXF.jpg)

It also appears that when "List list" is used, the normals of the spline vertex are broken/not used when setting array to "Use Spline Points":-

(http://i.imgur.com/grUnw82.jpg)

The latter problem is easily worked around, as the vertex normals of the spline are used when the spline is smooth. But with the normals being incorrect to spline line segments, that is a problem that cannot be worked around and makes it unusable for such as bolt/rivet heads etc.


Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 20, 2014, 10:25:20 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-20-14.rar

Also, Spline tool is improved. MMB/RMB can be used to create first/second control points. To control new segment's line/curve type, use the "Line" option in the tool's control panel.
Title: Re: Spline Tangents on "line list"
Post by: steve on July 20, 2014, 02:21:45 pm
Hi IStonia,

Try this

From very quick testing (I need to spend much more time with this to test/check fully).

It does appear there are now 3 types of spline. The "Smooth[Naturalized]", "Line" and "Line List"

The "Smooth" appears to be working as before.

For Line/Line list.

A "Line" Spline (as created from [visual tools]Create spline) is creating (using LMB) a spline with straight segments. The spline vertex are adopting the vertex normals from snap points, and the line segment normals are being smooth interpolated between the vertex normals. They are similar to if I had created the spline using "cusp" tangents, with the tangent handles aligning to previous/next spline vertex. That is good and very useful, but not good if being used for creating an array for bolt/rivet heads.

Spline created from "[visual tools > Create spline with "Line" option)
(http://i.imgur.com/W5SPAZK.jpg)

The Splines "Toggle Type", does toggle the "Line" into the "Line List" type of spline as seen before. The spline vertex are not aligned to underlying [snap] geometry, but the line segment normals do appear to be correct/usable for use to create an array for bolt/rivet heads.

"Line" spline toggled to "Line_List" spline
(http://i.imgur.com/lYwA4t7.jpg)

I presume that was your intention? Which IMHO is very good, as both those types of spline are very useful.

If I create a "Smooth" spline and then use the "Toggle Type", that changes the spline between being a "Smooth" spline to a "Line List" spline. But how about the ability to change from a "Smooth" spline to a "Line" spline? Would it be possible for the "Toggle type" to toggle through the 3 different spline types?, or have options to convert the spline to a specific type?(line, line_list or smooth), (of course, assuming the different types of spline I am seeing is intentional).
The reason I ask for that, is that when using "Edge tools> Create spline", the spline created is a smooth spline, so it can currently only be changed to a "Line_list" type of spline.

Hope you understand my explanation, I can post more info if required.


Quote
Also, Spline tool is improved. MMB/RMB can be used to create first/second control points. To control new segment's line/curve type, use the "Line" option in the tool's control panel.
Interesting, a good way to control the tangent handles while creating the splines. I need to test more before I can give better feedback/results of testing.
Title: Re: Spline Tangents on "line list"
Post by: steve on July 20, 2014, 03:13:46 pm
Also, Spline tool is improved. MMB/RMB can be used to create first/second control points. To control new segment's line/curve type, use the "Line" option in the tool's control panel.

I have been looking more into that. I do like it. The ability to control out/in tangent direction while creating the splines is a large step forward (IMHO).

--------------------

I am seeing a problem when attempting to close a spline after using LMB/MMB/RMB to create the spline

Example:-

Mouse clicks for creating the spline/tangent handle directions (last mouse click not yet made to close spline):-

(http://i.imgur.com/rr31AtP.jpg)

I LMB on start of spline and the usual popup shows asking to close spline.

(http://i.imgur.com/6XucdMs.jpg)

On pressing "Yes", the spline does not close, instead, the mouse cursor jumps back to last spline vertex, (with spline creation tool still active).

(http://i.imgur.com/odOur3S.jpg)

---------------------------------------------

When editing a spline to "Lock" or "reset" multiple or all the spline vertex on a spline, it appears you need to first select a single vertex to activate the tool, then select the rest of the selection. It would be better workflow (IMHO) to be able to select all the spline vertex then "Lock" or "Rest" without having to select a single spline vertex first.

Simple example:
I have a spline with multiple vertex. Change to Spline vertex mode. Enable "Spline Tangent" tool:-

[Currently], I need to select a single spline vertex, I can then MMB drag to select all the spline vertex(or part selection of). Then "Lock" or "Reset"

[Preferred], Select spline vertex with MMB drag, "Lock" or "reset" (which does not currently work)

Another point to that. If I have a spline vertex selected, then bring up the "Spline Tangent" tool, I need to select that spline vertex again to activate the tool. Should it not activate with the preselection?




Title: Re: Spline Tangents on "line list"
Post by: steve on July 23, 2014, 11:37:42 am
Hi IStonia,

I was looking more at the issue I mentioned earlier:-

Although I am not convinced the breaking of the relationship(tangency) between the flow tangent and tangent handles is good to do.........

It appears that when using "Instance Spline array", the array objects are aligned to the orientation of the flow normals, but when using "Slide" the slide is aligned to the underlying tangent handle directions. So we now have 2 different ways the tangency(the "Use tangent" options in the tools) is being implemented, which of course is inconsistent and leads to problems.

Here I will show you an example of attempting to use "Slide"

Although this is just an example, this is the kind of geometry I build a lot of the time with "Slide", where there is a need to create the slide tangent to underlying geometry. (think of building the supports of a race or big dipper type of track, then adding the track to the supports)

Here I have 4 simple box primitives, the track(slide) being added, so the slide is tangent to the normals of the box faces. (the box are not evenly spaced)

(http://i.imgur.com/3y2cRFi.jpg)

Using "Face" snap (snapping to those 4 box faces), I create a 4 point spline.
(http://i.imgur.com/EtpCEOu.jpg)

If I zoom into one of the box, you can see that the spline "Flow" normal is correct to underlying geometry, however, the underlying tangent handles are not tangent to the "Flow"(therefore not tangent to the underlying geometry)
(http://i.imgur.com/g38p7OX.jpg)

I create a simple spline to use for the slide, which I will be aligning to the path.
(http://i.imgur.com/WCwlVcL.jpg)

On using "Rotation snap selection" for the spline to slide to the spline vertex tangent of the path, the alignment is made to the tangent handles, which of course is no good, as it is not tangent to the box face.
(http://i.imgur.com/Udk4vwY.jpg)

So instead, I align the "Slide" spline to the box face. But on creating the slide, the slide is controlled by the tangency of the tangent handles (not the flow tangent), and as the tangent handles are not tangent to the geometry, the result is not usable (even if option to use tangent for the slide is disabled, the result is still not usable, as it is not tangent to geometry and the slide cuts through the box faces).
(http://i.imgur.com/UGovCCf.jpg)

So I have to edit the tangent handles as I did before the current change, to get them tangent to underlying geometry.
(http://i.imgur.com/7AUmqZt.jpg)

Once done, I can make "Slide" with result I want.
(http://i.imgur.com/OHuc7Ok.jpg)

So from that, I hope you can see there is a need for not only the flow normals to be tangent to underlying geometry, but also for the tangent handles to be tangent to the flow normals/geometry, otherwise there is still a lot of editing (as before) and prone to problems.


Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 26, 2014, 10:23:33 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-26-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on July 26, 2014, 03:36:30 pm
HI IStonia,

I have made some quick tests.

The spline vertex snap to geometry is now making both the spline vertex flow and tangent handles align correctly to underlying normals.

The problems I mentioned (with "Close spline" and preselection/selection for tangent handles for editing) are now fixed.

Excellent work!

I need to go through the various other tools/functions to check for any possible issues arising from change.(I will do that later today)



One issue to mention at this time.
The workflow when using "Toggle Type" and the new option in the "Tangent" tool > "Toggle Line List Flow Style" may be confusing (it appears to be a slightly broken process).

If I create a "Smooth" spline, then all appears to work as I would expect due to changes and new option. But after creating a "Line" spline, those 2 options ("toggle type" and Toggle line list flow style") do not work as I would expect.

For example.
I create a "Smooth spline" snapping to geometry. I use "Toggle type" and the spline toggles between "Smooth" and "Line". While the spline is "Line" the Tangent tool "Toggle Line List Flow Style" changes flow style. At any time, which ever "Flow" type I have set, I can always "toggle type" and the spline will toggle back to smooth. So that works well.

If I create a "Line" spline (visual tools > "Spline" with "Line" option enabled), the "Tangent" > "Toggle Line List Flow Style" does not work at all on that default spline. If I instead use the "Toggle type", the only change to the spline is that the spline vertex normal direction changes. After using "Toggle type", the "Toggle Line List Flow Style" does then change the "Flow type".

Should the "Toggle Line List Flow Style" not work on a default "Line" spline?
Should the "Toggle Type" not change the "line" spline to a "Smooth" spline?


Title: Re: Spline Tangents on "line list"
Post by: steve on July 26, 2014, 04:45:58 pm
Hi IStonia,

Creating splines with MMB/RMB in multi_views.

If I have Viewport layout of more than one view, there are some problems when creating a spline with added function of MMB/RMB. For example. In first view, LMB for start of spline...RMB(in same view) to create out_tangent_handle direction, move mouse over different view and the out_tangent_handle is lost.
That also appear to happen at other stages of spline construction, depending on what is being created (in or out handle direction).

------------------------------------------

When creating an open spline to non-planer snap points, the tangent handles on the open vertex are broken(not aligned).
(http://i.imgur.com/hGHWGRd.jpg)

Not a major problem. but....

If that was not intentional and can be changed so that the handles are aligned(both tangent handles aligned correctly to underlying geometry), would it also be possible for:- when creating a spline, if snapping to spline vertex, the created spline vertex flow normal and tangent handles adopt the underlying flow normal/handle direction from the spline vertex snap target? (well, I had to ask). Currently, when using Spline > "Add" or "Joint", the vertex tangent directions (on the open ends)are naturalized, which can be a pain, so was looking for a way to extend splines/blend splines without naturalize being applied to splines current vertex.


Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 27, 2014, 09:45:52 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-27-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on July 27, 2014, 03:00:44 pm
Hi IStonia,

On quick tests, I am just currently seeing some minor behavior issues.

I will try to explain:-

When creating a spline, with the first vertex of that new spline being a snap point to spline vertex, the new vertex flow/tangent is being adopted from the snap target, which is what I put forward, so that is good. However, the "In" tangent to next spline vertex(that is currently floating under cursor) has its "in" tangent also locked, which is not so good.

Here I have a spline, I will be creating a new spline with its first vertex snapping to that splines end vertex.

(http://i.imgur.com/EmUW1LD.jpg)

The "Out tangent" of the new spline is locked to snap target flow/tangency, which is good, but the "In tangent" to next vertex to be created(currently floating under cursor) is also currently locked(not so good).

(http://i.imgur.com/O092s7N.jpg)

When the LMB is used to create that new vertex, the vertex tangency does naturalize, but that makes it difficult to know what the result will be, as the "In tangent" of that new vertex cannot be predefined/controlled(unless snapping to other snap point), as when creating a spline with LMB/MMB/RMB, there is a specific order needed to be used, so in that example, I LMB to spline vertex snap point(which locks "out" tangent direction), but the next mouse button click must either be a LMB(to create new vertex) or RMB(to create out tangent for last vertex, which will removed the locked tangency already in place). The MMB to create "In tangent" to next vertex cannot be used, unless I have used RMB to manually created the "Out tangency" for last spline vertex). I hope that is understandable?

So in the case of snapping to a spline vertex I will make a suggestion, in that when snapping to a spline vertex, the "out" tangency is created/locked as if I have used the RMB to set the out tangency, that way the floating vertex under cursor is more controllable, and if needed I can used MMB to set "In tangent" for that next spline vertex.
A pic to try to better explain:-

From above example spline.
(http://i.imgur.com/u3KUvEM.jpg)

1: I create spline, with first point snapping to underlying spline vertex.
2: The "Out" tangency is created automatically as if I had used RMB (no actually mouse click made)
3: The next spline vertex(point) can now have MMB used if manual "In" tangent control is wanted, or snapping to a target will auto create that in tangent.

------------------------------------
I see you have changed the behavior of "Joint", so that auto naturalize is no longer used. That is good, many thanks. Is it possible to be able to "Joint" the 2 open ends of a single spline?(so it can also be used to smoothly close an open spline)

------------------------------------
The "Add" I see you have also changed. Currently it is not possible to use MMB/RMB while using "Add", also, if closing the spline, the spline auto naturalize.

-------------------------------------

The issue with multi views I mentioned in earlier post. The tangency created (with MMB/RMB) is no longer lost when moving across views, but all views do not update during construction of spline(only after next mouse click). (I do not used multi views, but test anyway).





Title: Re: Spline Tangents on "line list"
Post by: steve on July 28, 2014, 03:23:10 pm
Hi JTenebrous,

+1 to this, for sure.  To use Steve's exact  example, I'm constantly adding bolts/rivet heads to models (I usually do this in CAD software at the moment)... so having the spline vectors working correctly on paths created from an inset, etc. would be very useful in NVIL.

I would suggest you take a look at the latest build on this thread.

I have been making tests on various objects, all a lot more complex than the examples I have shown on thread, and now not seeing any issues.
Title: Re: Spline Tangents on "line list"
Post by: JTenebrous on July 28, 2014, 05:11:01 pm
Thanks, I'll grab it now... I've had a read over your/Istonia's posts in this thread over the last few weeks and am looking forward to trying out the resulting improvements.
Title: Re: Spline Tangents on "line list"
Post by: steve on July 29, 2014, 08:39:03 pm
Hi IStonia,

I see from the later dev builds you have locked out the rotation of the tangent handles while using "Tangent > Twist". I think that is correct to do, as the user should only be adjusting flow while in that mode. (I am wondering if the option "Twist" should actually be called "Flow", as there is now the option to "Lock Flow")

The problem is when attempting to rotate the tangent handles. I see that while using the "Tangent" tool, you can change to rotate manipulator, then rotate the handle(s), however, there is a problem when the manipulator is set to "Orientation > Selection", as although most of the time the rotation around "y" can be correct, the rotation around "Z" is problematic.

Here is a pic of a simple 4 point planer spline. Tangent tool enabled, with rotation manipulator set to "orientation > Selection"

(http://i.imgur.com/LsmTeFJ.jpg)

Using the rotate manipulator, I attempt to rotate around the selections "Z" axis, but the resulting rotation is incorrect.

(http://i.imgur.com/NYOBeYn.jpg)

Similar problem with "Translate" manipulator.
(Note: I did check while flow was unlocked and locked, but same issue.
While in spline vertex mode, I can rotate the vertex tangency using rotate manipulator(with orientation > Selection) and it works correctly while Flow is locked. But (IMHO) that would be strange workflow having to exit tangent tool to rotate tangent handles correctly to selection.)

Changing manipulator orientation to world/object, there is not such a problem, but while the manipulator is set in that orientation you cannot make correct rotation direction to tangent.

Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 30, 2014, 09:41:52 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-30-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on July 30, 2014, 12:31:27 pm
Hi IStonia,

Many thanks for the quick update.

I am seeing some minor inconsistencies with some functions and "Flow", but not sure yet if a problem(as only seen if certain circumstances), I need to test more, and will explain that later.

One problem I do see at the moment, is that "Add" is causing issue, as the spline vertex are not adopting underlying geometry snapping for flow/tangency correctly, it appears the flow is rotated 90 deg, and the tangency is auto naturalized. Only when the snap point is to close the spline is the flow/tangency correct(to snapping).
NOTE: That was testing while creating a 3d spline. 2d splines do not appear to have similar issue.
I was going to create pics to show example, but now found an issue with not being able to snap to "polygon_center" in other view ports(after changing to multi_view). But is working again after restarting Nvil.

I need to go into city center, so will continue testing when I get back.


Title: Re: Spline Tangents on "line list"
Post by: steve on July 30, 2014, 03:46:07 pm
Hi IStonia,

Looking at "Spline > Add".

You have now added the ability to use MMB/RMB functions for in/out tangency control, but it is not very useful currently if tangency (user settings) is wanted across [control] points.

As I mentioned in earlier post, when creating a "Spline" using the added function of MMB/RMB, they need to be made in specific order. You cannot use MMB(for "In" tangent for new point) without first using RMB(for "Out" tangent of previous point).
As simple example:-
I have open spline:-
(http://i.imgur.com/xH9REtR.jpg)

Enable "Add"
which gives me an extension that is tangent to end of spline. The point under cursor is floating and auto_naturalizing.
(http://i.imgur.com/uW0fLY6.jpg)

For that floating point, I cannot use MMB to set its "In" tangent. I have choice of:- RMB to create out tangent to last point, which is currently fixed/tangent, and in doing so may probably cause "Cusp" and break tangency(certainly if a 3d spline), or I can LMB which creates auto_naturalized point, and I am then left in the same situation, with a choice of LMB/RMB. The only way I could get it to work in a way for me to control tangency, would be if snapping to geometry works (spline point adopting underlying tangency), and creating geometry at the spline end_point(where the spline is added) with correct distance for tangent handle, so I can use RMB to create the out_tangent correctly for that point.



------------------------------------

Using "Add" snapping to geometry.

This worked in previous build, but now appears broken.

Spline created snapping to faces of box(s).

(http://i.imgur.com/AG8UEmz.jpg)

Using "Add" to snap to faces of other box(s), then snapping to end of spline to close:-

(http://i.imgur.com/kXLiBgS.jpg)

The "Flow" and "Tangency" (of the spline points) at snap points made by "Add" are not correct to geometry. Only the snap point to close spline is correct.


------------------------------
The problem I mentioned with not being able to snap to faces in other view-ports after changing viewport layout (to multi_view), that is an issue, but appears to be unpredictable. When the problem happens, "Reset View" does not help. I need to restart Nvil with multi_view already in place.
Do not know how long that may of been an issue, I do not normally use more than a single view layout.


 
Title: Re: Spline Tangents on "line list"
Post by: IStonia on July 31, 2014, 10:54:07 am
Try this
http://www.digitalfossils.com/Download/NVil-Jul-31-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on July 31, 2014, 12:56:07 pm
Hi IStonia,

Looking at "Add".

It is now possible to use MMB to control first (floating) points "In" tangent after enabling "Add". That is (IMHO) much better for user control. Appears to be working well on first tests. Excellent, many thanks.

There is still the issue of "Add" not using snapping point [geometry normal] for spline tangency, although "Flow" does appear to be correct. [To add:- As "Flow" is set correctly, and by default the "flow" is locked, there is only a need to "Naturalize" the spline to set the tangent handle direction to geometry. So not a major issue).


--------------------------

I will start re-testing the other spline tools/functions.

---------------------------

I was having another look at the issue I mentioned with changing Viewport layout to multi views, then having issues with face snapping. I have not been able to replicate that issue with this build.



Title: Re: Spline Tangents on "line list"
Post by: steve on August 01, 2014, 12:07:05 am
Hi IStonia,

I need to ask about the implementation you made with spline creation using the added functions with the MMB/RMB, as the way I am seeing this, it can be very difficult to be able to create a smooth curve, unless the curve is to only have 2 points.
Was it your intention for the MMB/RMB only to be used for 2 point splines? (if it was, you can ignore the rest of this post)


--------------------------------------------
If creating a spline with more than 2 points using MMB/RMB, the splines tangency can too easily be made as cusp.

Quick example:-

I start the spline with LMB, set "out" tangent with RMB. The "in" tangent to next spline point is auto created. I can change the start of the "in" tangent(for next spline point if required using MMB), but will leave as default, I then LMB to create next spline point. I LMB to create a 3rd spline point as shown.

Looking at the spline (before pressing enter to finish the spline), it appears that the 2nd point created will have tangent handles set as symmetric or asymmetric

(http://i.imgur.com/2paVBRr.jpg)

but after pressing enter to finish spline, the spline changes and the tangency is "Cusp", so not smooth.

(http://i.imgur.com/TeasZJU.jpg)

Another quick example, is while creating a spline, I make a RMB for control of "out" tangent.

(http://i.imgur.com/hCYgS0v.jpg)

The spline point from where I have made the "out" tangent, its tangent handles are made "cusp"

(http://i.imgur.com/u6kK65r.jpg)

So to create a smooth spline with more than 2 points using MMB/RMB, I would need to manually set both "in" and "out" tangent handles on every spline point to attempt to keep spline smooth.


Title: Re: Spline Tangents on "line list"
Post by: IStonia on August 01, 2014, 09:13:51 am
Try this
http://www.digitalfossils.com/Download/NVil-Aug-01-14.rar


There is still the issue of "Add" not using snapping point [geometry normal] for spline tangency, although "Flow" does appear to be correct. [To add:- As "Flow" is set correctly, and by default the "flow" is locked, there is only a need to "Naturalize" the spline to set the tangent handle direction to geometry. So not a major issue).

Naturalizing of these kind of spline points needs the information of the adjacent points. So during spline creation, it is not possible to get correct result. It is better to naturalize the spline after the creation or points been added/deleted. It might also be needed to do it a couple of times. For the "Spline" tool, if no line type segment been defined and no tangent control points added, the program will naturalize the spline automatically when the tool is closed.


Edit: I uploaded the wrong file. I have renewed it. Please re-download.
Title: Re: Spline Tangents on "line list"
Post by: steve on August 01, 2014, 01:26:44 pm
Hi IStonia,

On quick test with MMB/RMB (creating spline examples as shown in my last post), the tangency now appears to be correct, but on completion of the spline, pressing "Enter" or "Close"(on spline tool popup), causes "Unhandled exception"


I have also checked with a new config with same result.

Code: [Select]
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at DigitalFossil.AnimationDesign.AnimationDesignGraphicWindow.ModelDesigner.CreateCurveOp.Exit()
   at DigitalFossil.AnimationDesign.AnimationDesignGraphicWindow.ModelDesigner.CreateCurveOp.OnAppFormKeyDown(Object sender, KeyEventArgs e)
   at DigitalFossil.AnimationDesign.AnimationDesignForm.OnKeyDown(Object sender, KeyEventArgs e)
   at DigitalFossil.KeyboardControler.Form_KeyDown(Object sender, KeyEventArgs e)
   at DigitalFossil.AnimationDesign.AnimationDesignForm.OnDisableKeyCapturedDown(Keys key)
   at DigitalFossil.AnimationDesign.AnimationDesignForm.ProcessCmdKeyCore(Message& msg, Keys keyData)
   at DigitalFossil.AnimationDesign.AnimationDesignForm.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
NVil 1.0
    Assembly Version: 2.3.5326.41398
    Win32 Version: 2.3.5326.41398
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/NVil%201.0.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_64/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
CharacterClasses
    Assembly Version: 2.3.5326.41380
    Win32 Version: 2.3.5326.41380
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/CharacterClasses.DLL
----------------------------------------
SlimDX
    Assembly Version: 2.0.13.43
    Win32 Version:
    CodeBase: file:///C:/Windows/assembly/GAC_64/SlimDX/2.0.13.43__b1b0c32fd1ffe4f9/SlimDX.dll
----------------------------------------
WorkShop
    Assembly Version: 2.3.5326.41390
    Win32 Version: 2.3.5326.41390
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/WorkShop.DLL
----------------------------------------
BasicD3DClasses
    Assembly Version: 2.3.5326.41382
    Win32 Version: 2.3.5326.41382
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/BasicD3DClasses.DLL
----------------------------------------
DevExpress.XtraBars.v10.2
    Assembly Version: 10.2.4.0
    Win32 Version: 10.2.4.0
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/DevExpress.XtraBars.v10.2.DLL
----------------------------------------
DevExpress.Utils.v10.2
    Assembly Version: 10.2.4.0
    Win32 Version: 10.2.4.0
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/DevExpress.Utils.v10.2.DLL
----------------------------------------
DevExpress.Data.v10.2
    Assembly Version: 10.2.4.0
    Win32 Version: 10.2.4.0
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/DevExpress.Data.v10.2.DLL
----------------------------------------
DevExpress.XtraEditors.v10.2
    Assembly Version: 10.2.4.0
    Win32 Version: 10.2.4.0
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/DevExpress.XtraEditors.v10.2.DLL
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
msvcm90
    Assembly Version: 9.0.30729.4926
    Win32 Version: 9.00.30729.4926
    CodeBase: file:///C:/Windows/WinSxS/amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4926_none_08e1a05ba83fe554/msvcm90.dll
----------------------------------------
System.Management
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
AnimationPlay
    Assembly Version: 1.0.5326.41397
    Win32 Version: 1.0.5326.41397
    CodeBase: file:///C:/Users/Stem/Documents/NVil-Aug-01-14/AnimationPlay.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.

Title: Re: Spline Tangents on "line list"
Post by: IStonia on August 01, 2014, 09:09:42 pm
Try this
http://www.digitalfossils.com/Download/NVil-Aug-02-14.rar
Title: Re: Spline Tangents on "line list"
Post by: steve on August 01, 2014, 11:00:42 pm
Hi IStonia,

The spline "close/exit" issue appears to be fixed. Thank you.

On quick tests, looking good. I need to start testing all spline related tools/functions again, so will post back results later.

--------------------------------------

After more testing, I am seeing some minor issues, but as they are easily avoidable or correctable (or may not even be seen) by user, I do not think they are worth changing the code for (IMHO).

Many thanks for taking the time to make these changes/improvements.

Title: Re: Spline Tangents on "line list"
Post by: Darcvizer on October 21, 2014, 10:32:09 am
http://take.ms/WnD5v

Double mesh & select problem
Title: Re: Spline Tangents on "line list"
Post by: steve on October 21, 2014, 10:48:14 am
http://take.ms/WnD5v

Double mesh & select problem

The spline you have created is on both sides of the mesh. Zoom in to the spline and check.