daem-on / wtherion

A web-based Therion map editor
https://daem-on.github.io/wtherion/
MIT License
17 stars 2 forks source link

Can we snap to (active and inactive) objects? #22

Open CaverBruce opened 2 years ago

CaverBruce commented 2 years ago

Often it is desirable to snap objects being drawn to existing objects in an inactive scrap. The walls at the junction between two scraps is a common example. This avoids having to manually invoke a scrap join elsewhere in ones Therion input data. I might have missed something, but I cannot get the start or ends of lines, or new points to snap to control points (such as the ends of lines, line points or other points) on other objects. The only snapping I can get at the moment is snapping to close the line that is currently being drawn, and snapping (tolerance) with the Inspect tool. Am I having early morning brain fade perhaps? :)

daem-on commented 2 years ago

No you're correct, there's no snapping anywhere, and I'm not planning on implementing it, it's a very large feature. The idiomatic way to join two scraps is with the join command, if you try to do it when drawing the TH2 file it could be disconnected with morphing (or other ways I don't know about).

CaverBruce commented 2 years ago

My idea of best practice is to snap all conceptually coincident objects/points together, especially scrap/passage ends/joins, but also for any other point or line. Avoids potential for hard to find issues that can arise when Therion tries to identify the interior of passages and areas. Avoids gaps opening up due to morphing as well. Explicit join statements are my option of last resort. I use them only where implicit joining of snapped points is not possible, such as when the adjacent scraps are in different th2 files. Therion's ability to morph snapped points together is rock solid (in my experience over 10 years of use), and is preferable to establishing sometimes complex join statements outside of the th2 file. So I'd like to mark this as a feature request, to mimic the snapping functionality present in XTherion

daem-on commented 6 months ago

Hi again!

I think I've implemented the minimum usable version of the functionality you were looking for, as now the Detail select tool can snap segments to other lines. This will only work if you're

I'm pretty sure this is enough for joining lines together, and in the future I may add this to the Select tool where it will work on points. But I'm still not sure how it would be possible to snap multiple segments or objects when moving them.