Distance between (add) points ?

   4267   18   2
User Avatar
Member
766 posts
Joined: April 2014
Offline
How can I get the value or force the distance between two points using the add sop to be uniform; is there an expression ?
As I want to set almost precise measurements.
【T】【C】【S】
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Do you mean “distance in arbitary direction” :-?
Not a direct expression.
My stupid solution, hope I understood it right.
Edited by matthias_k - May 22, 2017 14:08:20

Attachments:
two_points.hip (68.7 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
ok, if you play the anim, you'll see that it is jiggling at the
6th decimal position.
File has visual output….

Attachments:
two_points.hip (83.7 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
766 posts
Joined: April 2014
Offline
@matthias_k - That is what I wanted, although is it possible to do this using a regular expression within the add sop, while using the polygon tab to connect the points ?
【T】【C】【S】
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
hmmm, if I'm right, then it is not possible with
a simple expression. Maybe a HDA with multiparam
like the one in the add SOP can be helpy.
And then put the logic in the HDA.
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
766 posts
Joined: April 2014
Offline
@matthias_k - Your vex example generates the connected lines by a re-sample based on how many points are added along the normals, and it's a great approach. Except, I want to attempt it another way whereas in my method the points are connected by the poly tab of the add sop then I uniformly adjust the spacing between each point.

If I create multi-parameters for each point, if I'm understanding you I'd need to control the spacing between each point. Is there not a vanilla expression (non-vex) I can use ? I've attempted channel referencing by referencing a previous points position (py0,py1 etc) then multiplying for example but it's not accurate.
【T】【C】【S】
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Hi Christopher,

what ist the usecase for this?
If you have more than 2 points, then it is easier in my opinion
to set first point,
then direction + distance for all theother points,
or am I totally wrong?
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
766 posts
Joined: April 2014
Offline
@matthias_k - I don't know what you mean ?
【T】【C】【S】
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
An HDA like the add SOP…
some stupid scratch HDA screen attached

Attachments:
something-like-this.png (333.4 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
766 posts
Joined: April 2014
Offline
@matthias_k why do you always claim what you did is stupid or dumb ? Or is it just a phrase you like to use when posting and shouldn't be taken literal ?

I never created and HDA. I assume by adjusting the distance sliders you can adjust the distance between the points. How about one slider adjusting the uniform distance between all points created with the add sop while using the polygon tab of the add sop to connect the points via lines ?

What is the guts of your HDA, if you don't mind showing or explaining ?
Edited by _Christopher_ - May 24, 2017 10:54:46
【T】【C】【S】
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Hi Christopher,

the HDA shown above was a simple “try”…
it does not deliver the result wanted by me.

What it is doing now:
It creates a point for each “add”
then it assigns a normal based on the direction inputs
and moves the point based on the distance along the normal.

What it is not doing at the moment:
It does not really computes the new “null position”
based on previous point position.


I'll refine it and post it when it's finshed :-)
Then you can have a look at it and maybe it is doing,
what you need.
Edited by matthias_k - May 24, 2017 11:54:36
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
here is the none finished version…
Edited by matthias_k - May 24, 2017 12:13:53

Attachments:
move_point_multiparm_03.hip (413.1 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
766 posts
Joined: April 2014
Offline
matthias_k
here is the none finished version…

Silly question, where are your parameters, as in; “my_points” ?

@matthias_k you presented some great methods for this problem, except I hope we can attempt one more as suggested; I was originally thinking, if there was an expression I could apply to the add sop and it would uniformly separate the points based on one parameter ?

If I didn't explain thoroughly let me know Don't mix up your solutions
Edited by _Christopher_ - May 24, 2017 12:26:46
【T】【C】【S】
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Switch added to have one distance param……
and now using pos from previous point

To come back to your expression:
The “add SOP” is generating points based on world space position.
If I'm right, then you can not get a unform distance between points
with this input option at all without problems.
Because you have to calculate the direction and then move the point
to the new position….
How is the distance defined?
+ you'll need first all points to iterate over them
and why would you like give world position, when you move it to another location then?

Attachments:
move_point_multiparm_04.hip (412.1 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Silly question, where are your parameters, as in; “my_points” ?

Do you mean the direction/distance inputs?
See image…

Attachments:
multiparm.png (108.9 KB)

English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
If I totally misunderstood your needs,
maybe attach a simple handdrawn sketch with comments :-)
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
766 posts
Joined: April 2014
Offline
I couldn't find any information that relates that the add sop lays points down in world space; how did you know ?

When you create a multi-parameter there not available for the user change, when hashtag is added ? There simply for, well, place holder in the code

and why would you like give world position, when you move it to another location then?
What did you mean ?

Interesting concept of using the cosine & sine to position the position of the points.
Edited by _Christopher_ - May 25, 2017 01:09:39
【T】【C】【S】
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
in world space;

you're right “world space” is the wrong “word”
what I like to say was, the points do not inherit positions from previous point.

When you create a multi-parameter there not available for the user change, when hashtag is added
??? It is on the “add_moves” subnet

Is the scene helpy?
Edited by matthias_k - May 25, 2017 03:07:23
English is not my native language, sorry in advance for any misunderstanding :-)
User Avatar
Member
766 posts
Joined: April 2014
Offline
The scene is helpful
There is no method to which to uniformly separate point by inherit the position of the previous point created by the add sop, neither regular expression etc. Looping over all the points and storing the results in a parameter is the only solution, from what I understand.

I assume I don't need to create an HDA and could create whether vex or attribute vop and place the parameters on each of either node ?
Edited by _Christopher_ - May 25, 2017 10:10:41
【T】【C】【S】
  • Quick Links