_ImportPointNetwork.js script, by Brian E. McMillin, February 2021
This script inputs a CSV style text file containing four fields,
[x, y, z, curveIndex], with "comma" or other delimiter.
The [] are NOT used in the file.
A three fields version for 2D points, [x, y, curveIndex], was NOT implemented,
due to possible confusion with CSV files without curveIndex.
curveIndex is a positive integer, which could include 0.
Each set of points has a different curveIndex = iCrv.
If the option to form Polyline(s) or ControlPts curve(s) or InterpcurvePts curve(s) is chosen,
then a different Curve is formed for each different iCrv.
Each row contains the point coordinates for one point, plus the curve index.
Rows for a set of points (with same curve index) need to be together, in order.
Companion script is _SavePointNetwork, which could be used to make a quick test file. One 3 curve test file is included in the zip.
It is anticipated that _SavePointNetwork is used to send the point CSV to a third party program, for processing.
The third party program would then export new X,Y,Z,curveIndex points, to be Imported back into MoI, as one of the 3 curve types.
Points could also be the result, but would be a cloud.
Credits:
Michael's scrip ImportPointFile was modified to create different curves.
The script has received only limited testing.
I had a lot of trouble getting the script to work, due to poor programming skills.
The last for loop had to have = instead of <, for some unknown reason, to plot the first point set.
.shift() was used instead of .pop().
No telling what the results would be for a weirdly formatted CSV file...
- Brian
|