FlatWorms

Last Update: 06 November, 2010 / version 1.1

RhinoScripted plugin generating 2D outlines from curves. It creates width-preview meshes driven by various parameters; mesh precision settings and preview mode are available along with tools for smart curve/polyline conversion.

FlatWorms script was developed as a patterning exploration tool and a laser-cutter companion.




REQUIREMENTS, DOWNLOAD AND INSTALLATION:__

Rhino 4.0 SR8 is required to run FlatWorms. It is recommended to install RhPicture plug-in - otherwise the bitmap-driven width feature will not be available.


DOWNLOAD, UnZip anywhere and drag-and-drop 'FlatWorms.rhp' and 'FlatWorms.tb' into any Rhino viewport. Once installed, new command: '_FlatWorms' will become available. You will also need to import the 'BlackOnWhite.ini' display mode that is used in the width preview viewport: Menu Tools > Options > Appearance > Advanced Settings > (Import button)

.............................................................................................................

TRIAL version is limited to 10 Curves. Unlimited version license can be purchased for $99.

After making the payment, run Flatworms and while in command line options go to menu Settings>License Request to generate license request file and follow the instructions.
.............................................................................................................
WORKFLOW:
1) Select Curves
2) Type width value or define other width source and settings
3) While in Width Preview Viewport adjust settings or go back step 2.
4) Hit ‘CREATE’ to generate the outlines

.............................................................................................................

OPTIONS MAIN MENU:
Options mode is transparent - Rhino commands can run during FlatWorms runtime.

Type Width value or:
GetDistance
- get 2 points to define Width.

Random
– define Random Min-Max Width range or Set of Values to randomly get the Width from. Random is affected by 'Settings > Variable Width Mode'.


FromCurveLength
– Min-Max width values will be assigned based on the curve length. It is possible to exclude some curves from length range calculation. Also, 'Inverse Attractor Values' from 'Settings' will affect this option (short curves will be the thickest when enabled).



UseAttractor - select an attractor from the list to drive the curve Widths: ( all Attractor-driven options are affected by 'Settings> Variable Width Mode' ) Distnace To Objects, Along Curve, World X, Y or Z, Surface U, Surface V, Reference Bitmap.





VWMode ON/OFF - toggle VariableWidth Mode. See 'Settings' section for more info.

Settings:Adjust Tolerances - curve width mesh precision can be defined here. Any curve before adding width mesh is converted to polyline using angle tolerance and tolerance settings similar to these found in Rhino ‘_Convert’ command.
Rounded Ends – adds rounded ends to the preview mesh/outlines.
Offset Closed From Center (%) - define width percentage of outline offset ( currently works with closed curves only ). Negative values will result in offset inside.


Round Width Values – rounds the width output values to any given positive value. (example: for min-max values 1-2 and round=0.2 the resulting range will be: 1, 1.2, 1.4, 1.6, 1.8, 2 )
Attractor ReferencePtOnCrv – for attractor-driven widths and while not in Variable Width Mode, this defines attractor reference point for each curve.
Inverse Attractor Values – inverts attractor values and curve-length based width values.
Width % Variation Prompt – enable/disable random variation prompt after defining width source (except for the Random option). User will be asked to provide min-max percentage variation on top of the default width source value. (Example: for min-max range 1-2 and width variation min-max 75-125% the resulting widths will fall within 0.75-2.5 range ).
Smart Convert Prompt – enable/disable convert prompt at the end of the process.
Preview Vport Size – defines pixel dimensions of the preview floating viewport.
Variable Width Mode – enabling this mode will cause the width to vary along each curve driven by attractors, custom profiles or random factor. Curve width mesh will be sampled at the maximum given distance.
Adjust Sampling – while Variable Width Mode is enabled, the maximum sample point spacing can be changed here.




Stroke Profile Curves - VWMode must be enabled to make this option available.
Profile graph curves that drive the scale of outline profiles width can be defined here as well as the Min-Max scale range. In case more than 1 profile curve is defined, they will be assigned at random.
Notes: Profile curves must be in WorldXY plane; the profile curve scaling can be combined with other width driving factors.





License Request - to enable full version after purchasing FlatWorms, generate the License Request file from here and follow the instructions.
Help - link to this website.
About - Script info and contact information.

Tools:
Smart Convert Polylines to Curves – separate tool or prompt after polyline outlines are created ( if SmartConvert Prompt Setting is enabled ). Polylines are split only at segments meeting at an angle greater than threshold angle ( default=22.5 deg. ) and resulting segments are converted to degree-3 curves with control points spaced at max. given distance or smaller.Option to keep original polylines is available.



Convert to Segmented Polylines – converts any curves into polylines with points spaced at max. given distance or smaller. This method is used automatically in ‘Variable Width Mode’ to subdivide curves and available as a standalone tool from this menu.

PlanarSrf (Scripted) - This is equivalent of the _PlanarfSrf command. Currently the scripted version handles creating planar surfaces with lots of inner regions better than command version, therefore it is more handy to use with FlatWorms outputs.


Mesh Closed Planar Curves - creates meshes from selected closed planar curves.

Flow Along Curves - enhanced version of 'Flow' command. Define any number of Object Collections to flow along multiple curves. Standard 'Flow' command options are available + ability to scale the result based on target curve length. In case of more than 1 Object Collection is defined, they will be flown along curves at random order.





..................................................................................................................................................
 PREVIEW WINDOW OPTIONS:
Back – close preview and back to the main options.
Adjust Global Width – adjust global width or width min-max range.
Edit Individual – select individual curves to manually set new width.
KeepMeshAndExit – exits the script but keeps the preview mesh objects.
Settings – access main options menu settings ( change will not occur until REGEN ).
REGEN – regenerates the solution.
CREATE – creates outlines from preview meshes.
All width adjustments will result in regenerating the solution; settings changes will require selecting ‘REGEN’ to regenerate.
..................................................................................................................................................

Known Limitations:Creating outlines from preview meshes uses Rhino MeshOutline functionality. It is not limited to number of curves or mesh faces (the script was able to handle 50 000+ curves with over 1 million mesh faces) , so system resources are be the only limit.
The minimum allowed width is based on the unit tolerance set in the document options.
..................................................................................................................................................

////////////////////////////////////////////
SOME MORE EXAMPLES:
////////////////////