Modulation command, Envelope curves

 From: bemfarmer 9 Dec 2012  (1 of 7)
 Are there any thoughts on how to modulate a curve, or constrain the curve between two envelope curves, in 2D? It can be done with two parametric equations, by multiplying them. For example sine. It can be done with a brute force selection of say 1000 points, with two curves, and multiplying them. The lower curve could be different than the top envelope curve. Maybe some way to do it, using nurbs equations? Could be useful for Guilloche. Did some Flow, with line segments. Attachments: Image Attachments:

 From: Michael Gibson 9 Dec 2012  (2 of 7)
 5592.2 In reply to 5592.1 Hi Brian, the main way that comes to mind is using Flow - that does allow you to map one envelope curve offset from an existing curve path. I'm not really sure what you are asking about exactly though, do you want to form a kind of median curve between 2 existing curves? One possibility for that is to do a loft between the 2 curves and then extract an isoparm (Construct > Curve > Iso) from that lofted surface. - Michael

 From: bemfarmer 9 Dec 2012  (3 of 7)
 5592.3 In reply to 5592.2 Thank you Michael. The loft and isoparam is good to know, and quick. Attached is a pseudoModulation done with flow onto a 180 degree revolve of the modulating signal, and project. There is a little bit of distortion at the beginning and end, and the tips are not symmetric. I may try to modify lineweb, to add sine waves, in place of lines. EDITED: 19 Feb 2014 by BEMFARMER Attachments:

 From: bemfarmer 20 Dec 2012  (4 of 7)
 In order to explore creating curves in envelopes, the modulation of a high frequency sine wave, by a low frequency sign wave, was scripted. Here is a test modulation script, using sine waves. The similarity is AM radio. There are lots of equations with various variables, from a search of "amplitude modulation." Matlab has some also. I added an absolute value, which may be wrong. The script uses the factories array type format, adapted from LineWeb script. (Trying to add a second curve to the Sinewave script did not display well, like there was some conflict between the two factories.) I did not know how to assign colors to the factory arrays, but was able to color the curves, by adapted Michaels script "Assign styles to solids," by replacing breps with curves, and brep with curve. The style assignment could also be at the end, after the Commits. The side effect is that any other curves on the MoI screen with also have new colors :-) Is there a better way to assign colors to factory/factories/arrays, in scripts? Edit: 12/20/2012, updated to version2. EDITED: 19 Feb 2014 by BEMFARMER Attachments:
 5592.5 In reply to 5592.4 Hi Brian, > Is there a better way to assign colors to factory/factories/arrays, in scripts? Well colors do come from style assignments so to modify them you do need to assign styles like you're doing. One change you could though would be to only modify styles just on the objects that you are generating instead of other things too. Right now in the color assignment step, you've got: var curves = moi.geometryDatabase.getObjects().getCurves(); So that will go get a list of every curve that's in the entire geometry database, even ones that had nothing to do with your current generated ones. Instead try something like: var curves = factory.getCreatedObjects(); That should then get you a list of all objects that were generated by that particular factory after it was updated. You might want to make a helper function at the top something like this: code:```var g_style_index = 1; function AssignColors( factory ) { var styles = moi.geometryDatabase.getObjectStyles(); var curves = factory.getCreatedObjects(); for ( var i = 0; i < curves.length; ++i, ++g_style_index ) { if ( g_style_index == styles.length ) { g_style_index = 0; } var curve = curves.item(i); curve.styleIndex = g_style_index; } } ``` Then you could modify your other places to call it like this: code:``` <.....> // Three factory(s) to update. for ( var k = 0; k < Sfactory.length; ++k ) { Sfactory[k].update(); AssignColors( Sfactory[k] ); } for ( var k = 0; k < Cfactory.length; ++k ) { Cfactory[k].update(); AssignColors( Cfactory[k] ); } for ( var k = 0; k < AModfactory.length; ++k ) { AModfactory[k].update() AssignColors( AModfactory[k] ); } ``` Hope this helps! - Michael