The tool has been optimized and improved to use a 'melding-profile' at the end if desired... It has various glitches fixed and a new combined Toolbar...
Copyright 2009/2011 (c), TIG All Rights Reserved. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,INCLUDING,WITHOUT LIMITATION,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ### extrudeEdgesByRails.rb ### Extrudes an 'initial-profile' curve along one or two other 'rail' curves to form a faced-mesh group, a final 'melding-profile' curve option can control the mesh's final form. ### Usage: Make 2, 3 or 4 'curves' (Arcs/Beziers/PolyLines/Welded-Edges etc). These will represent the 'Initial-Profile', the first 'Rail', the second 'Rail' and the 'Melding-Profile' - these last two curves are optional - see below... The 'Initial-Profile' should share a common end vertex with each of the 'Rails': but if it doesn't it will be scaled to fit between these Rails and that might then have unexpected results... If you pick Rail-1 and then click on it again it will be used as Rail-2***, as if it were at the other end of the Initial-Profile. Then you are asked for the 'Melding-Profile': you can pick on the 'Initial-Profile' again to form a simpler mesh from just that one Curve, with it being proportionally scaled and rotated at each of the Rails' nodes - this method gives you little control over the rotation of the Final Profile as this is calculated to rules automatically derived from the Rails' relative node positions etc: however, if you pick on a different Curve [note that it can't be one of the Rails] that will then be used for the Final Profile at the Rails' end nodes; so using a 'Melding-Profile' like this means that all of the intermediate Profiles will have a proportional 'melding' between the 'Initial-Profile' and the [Final] 'Melding-Profile' along the Rails' intermediate nodes: with this method you can determine the 'morphing' of the Profiles along the Rails from an initial form to a final one, or alternatively you can use the same shaped 'profiles' for both, but with different rotations/scaling, so that you can then effectively 'lathe' a profile along non-circular rails and be sure that the initial and end profiles will be formed and located as you want them...
Looped curves for the profile or the rails are allowed, but they can give unexpected results... also don't try a melding-profile with looped rails unless you want the unexpected!
Run the Tool from Plugins > 'Extrude Edges by Rails'. or click on Toolbar 'Extrude Edges by Rails'. Activate this Toolbar from View > Toolbars if not loaded. Follow the prompts on the VCB. Pick the Curves in the order instructed... First pick the 'Initial-Profile', then pick the other two 'Rails'. You aren't allowed to pick the same Curve twice in this set of 3 unless Rail-1 is also to be used as Rail-2***. Fourthly you pick a 'Melding-Profile', or you can pick the 'Initial-Profile' again for a simpler mesh form without a fixed final-profile form etc. After selecting these curves it auto-runs the mesh-maker... A grouped triangulated mesh is made based on these curves... Then there are dialogs asking for Yes/No replies... If you want to 'reverse' rail-1's direction. [usful if the mesh is 'twisted', when the rails go in opposite directions...] Note that this dialog is omitted if Rail-1==Rail-2. If you want to 'reverse' the faces in the mesh. If you want to 'Quad' faces [i.e. smooth just the diagonals] If you want to erase any 'coplanar edges' in the mesh. If you want to 'intersect' the mesh with itself. If you want to 'smooth' the edges in the mesh. If you want to delete the original curves. You can Undo these steps individually immediately afterwards...
NOTE: Multi-segmented curves increase processing time exponentially... ... the mesh WILL eventually be made, but the screen might 'white out' and it might appear to stop for several minutes... but it is working... Rails/Profiles with the same number of segments/edges or with them as simple 'multiples' will produce the fewest facets. It is sensible to 'match' the segments in profiles/rails, otherwise a mesh can become VERY faceted or possibly uneven - and also it might take ages to make. For example, for two rails their segments for each part of a profile are dictated by the most segmented rail's total number: 10 + 10 segments=10 x 2 = 20 facets 10 + 9 segments=10 x 2 = 20 facets 10 + 5 segments=10 x 2 = 20 facets 10 + 2 segments=10 x 2 = 20 facets 10 + 1 segments=10 x 2 = 20 facets The lesser segmented rail will always have some of its segments re-divided to match the more segmented rail's total number. This division is spaced evenly for rails that are segmented as multiples, but this can only approximate to 'even' otherwise... The same applies to the profile/melding-profile's segmentation.
For a rail/profile that is to be 'linear' draw an Edge & Divide it as needed equivalent to the number of 'facets' required or to match its opposite rail/profile, then 'Weld' the pieces together into one 'straight' curve. If you want a single Edge as a rail/profile then make a single segment Polyline with BZ Tools, or make a Curve out of two edges [with Weld etc] and split the Curve with another perpendicular Edge and Erase this and the unwanted Edge in the Curve - then you have a Curve with a single Edge - alternatively Divide the Edge into two and get a seam in the mesh - you can always use a 'Erase-Coplanar-Edges' tool to minimize the divisions later or you can always add back any lost triangulation by using the 'Triangulate Quad Faces' tool... Occasionally Curves made from welded/re-welded/re-re-welded[!]/etc have vertices in an order that can be unexpectedly convoluted and create weird results - if you remake the Curve from scratch it should be OK. Sometimes cutting and pasting-in-place or grouping and exploding a problem curve can also fix it for use... If you want a simple circular 'Lathed' shape use 'extrudeEdgesByLathe' - it will give different results from 'byRails' mesh.
Donations: Are welcome [by PayPal], please use 'TIGdonations.htm' in the ../Plugins/TIGtools/ folder. OR
Version: 1.0 20091116 First release. 1.1 20091120 Glitch fixed with [most] ordered points. Can now double-click on one rail = so used as both. Debabelizer added, with ExtrudeEdgesbyRails.lingvo in TIGtools folder. 1.2 20091210 Rotation of Profiles adjusted to Rail 2 Vertices. 2.0 20091229 Fourth 'Melding-Profile' Curve option added. Segmentation algorithm improved to optimize facets and minimize the 'spitting' of rails/profiles. 2.1 20100107 General speed improvements and tidying up. Toolbar added and Tooltip Text added to command. Outliner clash minimized with start+commit changes. Undo's step back through Smoothing, Reversing etc. Rare incomplete coplanar edge deletion fixed. Faces orientation fixed if has a flat face at zero. 2.2 20100114 Toolbar now 'Extrusion Tools', with related Tools. Connected rails one-profile mesh twist glitches fixed. Erase coplanar edges - tolerance adjusted. Lingvo files updated for Toolbar text. French lingvo file updated [thanks to 'Pilou'] Spanish lingvo file updated [thanks mainly to 'Defisto'] Chinese lingvo file added [thanks to 'Arc']. 2.3 20100121 Typo preventing Plugin Menu item working corrected. 2.4 20100123 Minor glitch in picking order of curves resolved. FR lingvo file updated by Pilou. 2.5 20100124 Menu typo glitch fixed. 2.6 20100206 Resume VCB msg fixed. 2.7 20100216 All extrusion-tools now in one in Plugins sub-menu. 2.8 20100218 Rare glitch with helical rails fixed. 2.9 20100220 Color coding of picked curves added. Profile=Cyan Rail1=Magenta Rail2=DarkVioletRed MeldingProfile=DarkCyan 3.0 20100222 Tooltips etc now deBabelized properly. 3.1 20100312 Erasure of original curves glitch fixed. 3.2 20100330 Rare glitch with make_mesh/make_shell fixed. 3.3 20111003 Quad Faces option added [smoothed diagonals]. 3.4 20111004 Quad Faces adjusted to hide diagonals too. 3.5 20111023 Smooth now ignores edges with only one face. 3.6 20111113 Quad Faces option adjusted to Thomthom's latest specs.
It does resolve the issue of unequal segments in the rails (== the profiles used in 'Loft'), however, then you do need to set the 'profile' curve (which is the unchangeable 'bezier-path' pre-set in 'loft'!)... AND if the rail segments are not equal or at least simple multiples the facets made might multiply unreasonably !!!
Feedback please... it's still a little buggy...
0
Last edited by TIG on Mon Nov 16, 2009 11:05 pm, edited 3 times in total.
Pilou wrote:Seems that works like a charm ... Crashed if Rail1 is clicked first
I think that's because the profile (now rail1) would need to be infinitely small where the two rails (profile+rail2) meet... I think it's trying to make tiny faces in the 'corner'... I know of this glitch and I am looking at ways of trapping it - it's not 'foolproof' yet !
Just won the 'Who is Least Competitive Championships' where trying to win will make you lose. Trying to lose makes you win which makes you lose. Not trying at all makes you lose which makes you win which makes you lose.
The curious thing is that the Rail2 is a "straight line" So must be divided , then welded But result seems no reproductible and gives some nusty result
bug.png
PS A multi-profils along Rail1 rail2 will be sweet too
Pilou: I had similar results with the construction points on several attempts. Once, with rails made by Freehand tool and once with profile and rails made by Welded segments for profile and rails and once by smoothing out the profile with added arcs and Welding. Since TIG said the script was mostly stable, I figured that there would be some of this to happen.
0
I take the slow, deliberate approach in my aimless wandering.
mitcorb wrote:Pilou: I had similar results with the construction points on several attempts. Once, with rails made by Freehand tool and once with profile and rails made by Welded segments for profile and rails and once by smoothing out the profile with added arcs and Welding. Since TIG said the script was mostly stable, I figured that there would be some of this to happen.
Can you all give as much info about the failures as possible [PM me small skps if appropriate] Ruby Console messages etc - I want to debug this glitch
TIG: Thanks for the Example skp. I will try to provide you with examples as time permits. And I have been observing the Ruby console. My last experiment was with Polyline Divider as the profile and rails from Fredo's Bezier collection. I got the mesh ok, but of course, the math complexity reversed and crisscrossed the beginning and ending copies of the profile causing an oblate spheroid bulge(same shape as an American football) and wings like Pilou's harlequin flying fish. However, there was no comment in the console. Unfortunately the file is saved on my home machine. I will have to send it later.
0
I take the slow, deliberate approach in my aimless wandering.
hey TIG here's a problem i've run into sometimes in an instance where it seems it should work. i'm only getting partial results in this case. any ideas?
using that same file, here's another weird thing i can't figure out. (a video's probably easiest for me because i don't have to type as much )
(at first, it shows the problem i was previously talking about) after that, i copy/move the profile and each rail the same amount along the red axis.. then end up with entirely different results. ?
0
Last edited by jeff hammond on Tue Nov 17, 2009 6:26 pm, edited 1 time in total.