How can we prevent face rotation in "folllowme"?

Dear friends,
In the following example, face1 (triangle) rotates during followme. I wish the base of the triangle always will be parallel to the x,y sheet. Is there any simple way to prevent triangle rotation during followme? Thank you for your help in advance.

pt = []
pt[0] = [-50, -50, 0]
pt[1] = [0, 0, 0]
pt[2] = [50, 50, 50]
pt[3] = [50, 100, 100]
pt[4] = [100, 100, 150]
grp = Sketchup.active_model.active_entities.add_group
path1 = grp.entities.add_curve pt
pt1 = [-55, -45, 0]
pt2 = [-45, -55, 0]
pt3 = [-50, -50, 20]
face1 = grp.entities.add_face pt1, pt2, pt3
face1.followme path1

Follow Me “mirrors” the cross section of the extrusion along the bisector plane of each corner. This can result in what seems like a rotation along the extrusion.

One of my first extensions ever is a version of Follow Me without this behavior. Maybe it is helpful to you. However, the code can be quite messy and unorganized so it’s probably no good source of inspiration for coding styles or the like.

https://extensions.sketchup.com/extension/ef5e2452-244d-4905-8696-35ef63e48363/eneroth-upright-extruder

1 Like

Thank you so much. Your extension is really useful but it seems we don’t have simple solution for this problem in ruby.

The Ruby API has no option for changing the Follow Me behavior. This isn’t unique to API, but is something users using the graphical UI has also brought up.

1 Like

Tangential question: Any particular extensions which you think are a good source of inspiration, coding styles, or the like? I’m compiling a list of code to study – mostly extensions from you and Thomthom :stuck_out_tongue:

There are some very good ones (well, I think so!) by Steve Baumgartner on SketchUcation plugin store (not Extension Warehouse).

I worked jointly with him on the the design and debugging of some over the past few years, but most of the difficult code is his, and very clever too. My bits were much more straightforward bread and butter stuff.

@slbaumgartner can perhaps comment on which he thinks were good examples for others to follow. I know some were VERY difficult to get to work reliably in all the possible ‘edge cases’ - particularly Wood Framing.

3 Likes

For sure nobody wants you to change this behavior although adding directional followme can be a good idea.

For sure it is not simple. Let’s see how Christina solved this problem.


As we can guess from this picture, she added a triangle to each breakpoint and make faces between The triangle’s sides. If one face not possible she made 2 faces. (I guess it from the picture). I wish to know the logic of your solution.

I don’t know that I would call any of my work a model of good coding practices! But there were some instances of things that were quite tricky to get working.