Gumball possible behavior or more specific custom widget?




I have a mesh surface onto which I want to project a special planar curve like an ellipse. To allow precise positioning of the curve, I would like to constrain its center always touch the mesh surface so its supporting plane is tangent to the mesh surface at the contact point.

Can this be achieved with a Gumball or would I need a custom Widget? If so, is there a Python code example upon which I could base my custom widget?




Here is what Bruno is talking about: The right curve is at the initial location. When moving it to the left side, we would want it to rotate automatically towards the mesh, as shown at the left side with its gumball. Here, the rotation has been done manually.



(Pascal Golay) #3

Hi bmartin - so you want to slide the curve around ‘freehand’ but in a way that is constrained to the mesh, paying attention to the normals, is that correct?



The final result would be just what you described but I would be glad to make it work in 2 steps (implementation might be way simpler):

  1. Just constrain the “middle” of the planar curve to be a point on the mesh. The normal at this point would define a plane where my curve would lie. Moving this point along the mesh would make the plane change as it adjusts to the new point normal of the mesh.
  2. When the positioning is satisfying, project the planar curve onto the mesh in the direction of the normal at the contact point defined in 1).

Also, as my curve is not a circle, during step 1), I would like to be able to rotate the curve around the axis defined by the contact point and the mesh normal. This way, I would be able to control precisely its position and orientation before projecting on the mesh.

Does that makes sense to you?


(Pascal Golay) #5

Hi Bruno - it makes sense, but I do not see how to get there easily- I’d ask the giant brains over on the scripting and developer forums-