Hi Christina (@eneroth3),
Recently @DaveR mentioned your “Upright Extruder” plugin.
It is very well suited to create the thread of a screw or nut. So far I created the threads manually.
Do you still plan to maintain and enhance this plugin?
If so, then I have the following enhancement ideas:
In the plugin descrption you write:
“To avoid unexpected results make the first edge of the path start at the profile face’s plane and be perpendicular to it.”
Could the plugin makes the starting face perpendicular to the first edge of the path by projecting it along the first edge? (and then also connect bac to the original face)
Secondly, it would be nicer, if the generated faces would not be triangulated, but be planar quads, by having the extruded edges being parallel to the path along which the path is extruded.
If you consider enhancing the Plugin, please let me, know.
The upright extruder is one of my oldest extensions and not one I maintain any more. I’d like to rewrite it completely one day if I could find the time.
I haven’t ever drawn a screw in SketchUp actually, but I’ve seen people writing this extension helped them with that.
Regarding perpendicular cross section the extension allows them in the case a user actually wants to draw something skewed along its length, but in most cases you don’t want that, that’s why the description warns about it.
Regarding triangulation the extension shouldn’t be adding any edges that aren’t necessary for the faces to form. When possible it even draws continuous “sausages” rathe than a series of quads. There is no forced triangulation.
indeed the last update of the plugin is a long time ago.
As DaveR mentioned as well, most of the screw drawing plugins have some short comings. I think as well that combining manually some base plugins is better suited for drawing precise threads.
Perpendicular starting face: the native “follow me” tool also projects the original face along the first edge onto a plane perpendicular to the first edge. This projected face is then taken as the starting face for the follow me. I think this is very good and Upright Extruder could do the same thing. Connecting this starting face in the end back to the original face would be consistent and intuitive (the native tool does not do it).
Triangulation: Yes, there are no excessive edges in the “upright extruded” geometry, but I guess one could generate the geometry such that less “triangles” are needed.
The only way to have less triangles is to not keep the extrusion “upright”, but do what native Follow Me does. From a geometric point of view it’s a quiet interesting behavior, even though it’s usually not what you want.
Yes. You can do that already. It requires using fewer segments in the path.
It is indeed interesting.
The original “follow me” to keep the orientation of the face constant relative to the path and the “upright Extrusion” to keep the orientation of the face constant relative to the abosute (world) axis.
What I mean with less triangles:
You can try to remove a diagonal and you’ll see that the faces disappear too. SketchUp requires faces to be planar. Curved surfaces need to be divided into smaller facets.
Yes, the diagonal edges are needed as drawn, that is clear.
The path is an arc with all segments having the same length.
If you look closely at the generated faces selected in the end, you see that there are more faces generated for the related segment than for all others segments -even though all segments of the arc are the same.
If you rotate the profile to make it perpendicular to the end segment before extruding the faces wont be double curved and the triangles wont be needed.
The geometry generated is fine for all segments of the path, except for the second and third last segment. Since the path is a simple arc, the geometry generated per segment should be the same for each segment (except the first and possibly the last one).
I figured that this behaviour is not consistent. Sometimes the geometry is generated nicely, sometimes not. Strange, but not a killer.
SketchUp uses an internal tolerance so if the faces are very, very close to being on a single plane, even if they logically shouldn’t be as the surface is doubled curve, they can form anyway.
As mentioned earlier in this topic, I created “upright extrusions” manually so far.
Now I compared my manual process with the result of the plugin and found differences.
At the vertices of the path, the extruded face should lay on the angle bisecting plane of the two edges connected to the vertex.
With the geometry generated by Upright Extruder, this seem not the case.
Is this observation correct and if so, is this on purpose?
If the face you extrude isn’t perpendicular to the end segment, that angle difference is carried over to all of the vertices and the profile wont line neatly on the bisector. This is why it is recommended to make the face perpendicular before extruding it.
Yes, the starting point is a face perpendicular to the first segment of the path.
If the path is in a flat plane, then the profile is along the angle bisecting plane.
But if the path is not in a flat plane, then the generated profile in the vertex is not nicely along the bisecting plane.
To make the profile perpendicular, I turn it around the “upright direction” until the profile is parallel to the face normal of the face defined by the first segment of the path and the “upright direction”.
Is this as well your understanding.
The profile doesn’t appear to be parallel to the up vector. Can you share the file?
The attached file contains two examples. One where the path is a flat arc and one where the arc is pulled along the blue axis.
For both examples I did a follow me, an Upright Extrusion and Manual constructed “upright Extrusion”.
The upright vector is always the edge connected to the path pointing upwards.
I would expect the profile along the path to have always the same area. (green faces in the Manual geometry have the same area and red in the Upright extrder geometry). But the Upright extruded geometry has most of the profiles with a different area.
I think the reason for this is, that the profile does not follow the angle bisecting plane.
UprightExtruder compare.skp (259.8 KB)
If you want single curved faces (no triangulation), make sure the start profile is perpendicular to the end segment of the path. This is the only way to align the additional profiles with the bisectors. When doing this, ever surface extruded from an edge parallel to the upright vector will be single curved. If there is an angle difference at the start profile, that angle is applied to all other profiles as well.
That is what I have done, but still the size of the profile in each vertex is different. Since the path is an clean arc, I would expect the profiles in each vertex to be the same area and shape. (Exceptions can be at the beginning and end, due to the “perpendicularity constraint”). But the generated geometry does not fulfill this.
The manually created Upright Extrusion in the file has the profile in each vertex with the same size.
Side remark: to generate the geometry it is not necessary to have a perpendicular face as a starting face. This is true for the native follow me and for the Upright Extrusion.
Happy to share the steps how to create these geometries, if you are interested.
I think I found the issue with the profile in the vertices not always being along the angle bisecting.
In the Plugin the rotation angle is calculated from “the angle bisecting line of the flattended path” which is not the same as “the flattended angle bisecting line of the path”.
(I am not a ruby developer!)
vector1 = flattenVector((path[i].- path[i-1]), [Geom::Point3d.new, vectorUpright]).normalize
vector2 = flattenVector((path[i+1].- path[i]), [Geom::Point3d.new, vectorUpright]).normalize
vectorRotation = Geom::linear_combination 1, vector1, 1, vector2
vector1 = (path[i].- path[i-1]).normalize
vector2 = (path[i+1].- path[i]).normalize
vectorRotationPath = Geom::linear_combination 1, vector1, 1, vector2
vectorRotation = flattenVector(vectorRotationPath, [Geom::Point3d.new, vectorUpright])