← All ideas
  • Published 30 Mar 2016

API for Snapping - supporting addons for architecture

Architecture is a area that could be further explored in the addons. However the lack of exposed snapping functions in python, limits (significantly) the creation of addons for this purpose.

Therefore, I propose the creation of a snap method to the class "Object". So we would have something like ...:

Object.snap_ray_to_geometry(origin, direction, dist, snap_vert, snap_edge, snap_face, use_depth, virtual_cone)
  • origin -> Vector;
  • direction -> Vector;
  • dist -> minimum distance to snap between the element and the ray;
  • snap_vert, snap_edge, snap_face -> bools indicating which elements are used for snapping;
  • use_depth -> ignore what is hidden behind the face.
  • virtual_cone -> bool. The minimum distance is multiplied by depth (useful for perspective view)

This function would return the coordinated, the index and the type of the element that received the snapping (Vertex, Edge or Face).

100%

Development Status: Open

Upvote 5 Downvote 0
mano-wii
30 Mar 2016

4 Comments

theoryshaw

Bruno Perdigao is starting a new snapping system in Bonsai (formally BlenderBIM): github.com/search

campbell

Note, this might be better as a design task on Phabricator.

Issue is more to find a nice design then to figure out if people want it or not (a way for Python to snap is of course useful).

campbell

How would this handle perspective views? (where elements that are close will how as being far apart because they're close to the camera)

mano-wii Author

I saw your comment just now. I added the virtual_cone parameter.