Re: Super node snapping

"brynn" <[email protected]> Thu, 9 May 2019 09:27:37 -0600
Newsgroups gmane.comp.graphics.inkscape.devel
Message-ID <7F91B27A993140D38CD82B2DDA50EA20@brynnPC>
Hhmm....  I can't answer as to the do-ability of this.  But just curious.

It would take some time to set up the hooks or super nodes, I guess.  So the use 
case would have to include many needs for it (many dolls and/or doll dresses) 
before it makes sense.  Right?

No idea if it could be done.  But it's an interesting idea!

brynn

-----Original Message----- 
From: David Mathog
Sent: Wednesday, May 08, 2019 5:35 PM
To: [email protected]
Subject: Re: [Inkscape-devel] Super node snapping

On 08-May-2019 13:20, David Mathog wrote:
> Inkscape currently has a way to snap a drawing node to another drawing
> node.  Is there a way to associate a "super snap node" with an object
> which would take precedence over the drawing nodes?

Having thought about this a little more, let us call this a HOOK
(because super node is a mouthful) and define a HOOK as:

a two point path like:
   M 27.214285,42.244047 82.398808,93.648809
with a description field like:
   SPECIAL_HOOK text_tag
A HOOK is not normally visible and like any other object may be part of
a grouped object.

In HOOK alignment mode when an object containing a hook is dragged over
another object containing a hook the program would locate all hooks (two
points, special description field) and then compare all tags in the
hooks in the two objects.  If it finds a closest pair of hooks with
matching tags it offers to align (as with nodes, currently).  If
accepted the dragged object is placed so that its first point is on the
first point of the target object's hook and its second point is on the
second point of the target object's hook.  To do so the object is
rotated and scaled as needed.  Calculating the angles and scale factors
is a trivial calculation, for two vectors in a plane.

Consider a simple use example.  We have all seen the children's game
with paper dolls and paper clothes.  Now imagine that each doll has
HOOKs that say "head", "torso", "left hand", "waist", "legs", "right
hand", "left hand", and so forth located in the appropriate places.  In
the same drawing there are objects of clothes with matching HOOKs.  A
hat has "head", a  belt, pants, or skirt have "waist", gloves have
"right hand" or "left hand".  These clothes may be arranged in any
orientation on the screen and for the sake of argument are much smaller
than the dolls.  The dolls are standing on a drawing of a hill so that
they are at different angles.  Nevertheless, grab a dress and drag it
onto a doll, and it will snap to fit in exactly the right way.  There is
no need for manual
alignment, scaling, or rotation.

For this to work correctly the "unit vector" used when constructing the
clothes must be compatible with that used for the dolls.

This doesn't seem to run afoul of anything in SVG, it is just a
description of how
the program manipulates objects which are so described.

Exists?  Nearly exists?  Wild pipe dream?

Thanks,

David Mathog
[email protected]
Manager, Sequence Analysis Facility, Biology Division, Caltech


_______________________________________________
Inkscape-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/inkscape-devel