MoI discussion forum
MoI discussion forum

Full Version: Conformal Mapping to the Torus

Show messages:  1-16  17-36  37-45

From: bemfarmer
28 Jan 2019   [#17] In reply to [#16]
On second thought, I'll just incorporate the conformal map node into a macro. :-)
- Brian
From: bemfarmer
28 Jan 2019   [#18] In reply to [#17]
Created Macro for conformal rCircle and RCircle.
Sweep node of the two circles works easily. About 12 seconds or so...
Placed the two nodes conformal and nonconformal mapping into a separate file, which can be copied to the nodeeditor/nodes/extensions folder.
Delete the transform2Mod files.
Added 90% to 100% scaling of individual hexagons. The number of columns and rows and planar domain remain the same size.
Added throughpoint curve, in addition to interpcurve "type". They are nearly identical, except at high magnification.
Added a Switch widget to switch between forming a full torus "grid", and a two column only grid, which is faster, and circle array-able.
(Did not add circles Macro for nonConformal node yet. Should be extremely easy...)

After forming the torus grid at 90%, do Rebuild and Join of hex sides.
Then do trim of torus by the grid. This takes over a minute or so.

For the previous nonconformal node assembly, replace the nonconformal node with a new copy.

- Brian

Have not done a FLOW shrinkage yet...


Attachments:
ConformalMAP2019.zip

Image Attachments:
HexGridTangerineTango02.png 


From: bemfarmer
28 Jan 2019   [#19] In reply to [#18]
A couple of days ago the FLOW "shrinkage" worked.
Tonight FLOW is squashing and squeezing the hex "ribbon." :-(
Will make a fresh try tomorrow, or so.
- Brian
From: bemfarmer
29 Jan 2019   [#20] In reply to [#19]
In an aha moment this morning: In order for FLOW to get the expected result of shrinking the pattern on the mapped torus, onto a torus of smaller r radius, and equal R radius,
it is necessary for the two tori to have the "seam" edge in equivalent locations. In this case the seams can both be in the center curve of the two donuts.
Otherwise the squish and stretch effect will occur as the inner hexes and outer hexes swap places.

(For special effects the seams could be located differently.)

- Brian
From: speedy (AL2000)
30 Jan 2019   [#21]
Hi Brian and Friends
An unconventional mapping on the Torus,
using your first Script ...
with some further precautions, I can get R1 and r,
and most importantly, the central point to the mapped hexagons
normal to the surface ..
This gives me the possibility to act on the basic hexagon for further transformations ....
I saw your new Script and it's Ok ...
it would be interesting if I could provide in output, the mapping of the Hex-normal face centers to the Torus Surface,
it would be a formidable tool for subsequent Transformations ... what do you think?
In any case, thanks for this last improvement-
As usual, the file is at this link:
http://www.mediafire.com/file/9au0nfcccmiog8z/CP_CMArrayHex.zip/file
Have a nice day to all
alberto
From: Karsten (KMRQUS)
30 Jan 2019   [#22] In reply to [#16]
Hi Brian,

>>>>>The few nodes with more than one output slot seem to have the same number of elements in each output?
Ehm -no. number of Outputs and Type, and also the number of elements are independent.

>>>>> The number of declared outputs must equal the number of outputs defined, or there is an error...?

Each declared Output (addOutput) should also be defined (this.setOutputData) means - give it a value - that's the sense. The different outputdata are stored in an array for the different Outputs. The setOutputData method needs an index where to store the generated data in the array. If a method try to Access the Output Array of a node, the method should find data with the right types - I'm not sure, but I think Max places empty data with the right type to the Output Array by default while Output creation to avoid problems. At the end the Outputs are this Array.

Have a nice day
Karsten
From: bemfarmer
30 Jan 2019   [#23] In reply to [#21]
Hi AL2000,

The centers of the flat torus are available. Their conformal mapping should be the center of the mapped hexagons. (?)
To form vector, the start point is a corresponding point on the Rcircle, which is the center of the rcircle through the corresponding center point of the hexagon.
Each of such start point can also be calculated from u and v. (?).

This should be fairly easy to code in the .js. I'll try...

- Brian
From: bemfarmer
30 Jan 2019   [#24] In reply to [#22]
Thank you Karsten.

Is there an example *.js node which outputs many objects, and only one, say a circle?
(My attempt to output one circle resulted in output of as many copies of the circle as there were objects output...)


- Brian
From: Karsten (KMRQUS)
30 Jan 2019   [#25] In reply to [#24]
Hello Brian,
PatternSelArray, getCrvSFrame, ... gives independent different Outputs with different length.

it sounds that you tried it in a multiprocess function. Okay - could you post an example of the code? It is easier for me to figure out what happens on an code example.

Have a nice day
Karsten
From: bemfarmer
30 Jan 2019   [#26] In reply to [#25]
Hi Karsten,

Attached is a new .js node BADConformalMap, which will run in the node assemblage in about 12 seconds, but makes 100's of circles, instead of only 2.
The BadConformalMap.js can simply be copied to the nodeditor/node/extension folder.

The node assemblage is "ConformalMappingHexGridToTorus4BAD.

(Modifying the .js file requires that its former copy in the node assemblage be replaced with the modified version.)

I guess that a second multiProes needs to be added???


- Brian
From: Karsten (KMRQUS)
31 Jan 2019   [#27] In reply to [#26]
Hello Brian,

it is a Problem with the using of the multiprocess function. It is in your case not necessary to us it. It's more useful to use it for multiple data with n x m permutations. The core System calls it - depending of the mode for each data object in the Input stream. You have to create dummies for the Output in it, because the core System try to evaluate an Array of results as Long as the defined Outputs.
I've made some changes to your file - please study it. At the end it would be better and faster to process your curves in a for-loop and not in a multiprocess function.

Have a nice day
Karsten

p.s.: Nevertheless -Congratulations! It Works:-)

Attachments:
Mapping.js


From: bemfarmer
31 Jan 2019   [#28] In reply to [#27]
Thank you Karsten.

I will study it.

- Brian

Meanwhile, it was not very hard to turn the torus curved hex lines into a mesh with a square cross section, a solid, by using FLOW
to create the hex pattern on a slightly smaller torus with the same Rcircle. (The torus seams should match, i.e. both be on the same side of the tori.)
(The inner seam is made to match by creating the inner sweep circle by selecting the proper point, after selecting the circles center.)
(The seam of the circle can be checked by using the shortcut key for MarkCurveStart, on the circle.)
(It is helpful to have several different color styles in play.)
1. Create the surface pattern with hexes that have a small space between. This same space is used to form a smaller sweep circle of (r_radius-space), centered on R,
to make the smaller, inner torus.
2. Then for the outer edges, use the shortcut key v1.2 "select outer edges", (hide the 12 inner seam edges,) and join the hex sides to get hex curves.
3. Repeat for the inner edges.
4. For a pair of 12 adjoining hexagons, (which were two columns), perform 24 lofts between inner and outer edges. (24 manual lofts.)
5. Circular array these 24 hexagons, 12 copies around the torus.
6. Boolean Union the outer torus band, the 24 hexagon sides, and the inner torus band, to create the solid cage.
(A small circular Fillet did not work, after 20 minutes.)

- Brian

Image Attachments:
BlueCageSolid.png 


From: bemfarmer
31 Jan 2019   [#29]
Here is the simple algebra for calculating the two formulas for the "r" and "R" radii of the sweep and rail circles for the destination torus for the conformal
mapping to the torus. The formulas are incorporated in the conformalMapping node in mapping.js.
- Brian
(see next post)
From: bemfarmer
8 Feb 2019   [#30] In reply to [#29]
Updated .pdf for algebra and trigonometry to calculate r, R, rcircle, Rcircle, "center"points of hexes, normals.
The nice png graphic of a .3dm, with alt codes for theta and phi helps to explain the math.
The map is subject to verification, and could have errors, or typo's?

The center points of the planar hexagons, after conformal mapping, are only "more or less" center points of the "hexoids" on the torus.
These points are now mapped in an update to the conformalMapT node.
Also, registration geometry such as a square and triangle can be Style selected, (I used color "coral"), concatenated with hexagons, and mapped to the torus.
The registration marks should be added by hand to quadrant I of the MoI screen, before the .nod file is opened.
Circles are not closed after mapping due to software error/incompleteness.
https://moi3d.com/forum/index.php?webtag=MOI&msg=9066.6

Still need to code normals/lines through the center points.
I'll plan on posting the updated conformal node in a few days.

It was very difficult for me to get the points input and output slots coded correctly, with flu zombified brain, but Karstens corrections helped.

Is it possible to have TWO multiprocesses running in a node?

- Brian

I plan to draw some "hobnail" geometry of the Fenton glass type, as a memorial. It appears to be partial spheres in a hexagon arrangement.
I'll have to measure the percentage of a sphere. It is in tapered spirals.

Also used gemarray to place cones on the surface of a torus. The density in the center became too high, and needs size reduction/scaling, or thinning:-)

Attachments:
RadiusCircles_Theta_Phi_Normals_Centers_ForTheConformallyMappedTorus.zip


From: bemfarmer
15 Feb 2019   [#31]
A fairly unique ribbon?
From a conformal kagome torus mapping.

- Brian

Image Attachments:
ConformalKagomeRibbon.png 


From: Anthony (PROP_DESIGN)
15 Feb 2019   [#32] In reply to [#31]
very cool
From: Karsten (KMRQUS)
15 Feb 2019   [#33] In reply to [#31]
Looks Great! Chapeau!

What's next?
From: Mindset (IGNITER)
15 Feb 2019   [#34] In reply to [#31]
Wow!
How can we do that?
From: bemfarmer
15 Feb 2019   [#35]
Thank you everyone.
Hi Igniter,
Attached are the additional nodeeditor files needed.

For MoI4Beta, to plot the torus curves:
1. Have nodeeditor installed, on Windows (hopefully in %appdata%), or Mac, as documented on the forum.

2. Add MappingC.js to the nodeeditor/nodes/extensions folder. This will add ConformalMapT node to the transform2 menu. (I have yet to add normals to this node.)

3. Backup and replace objects2.js in the extensions folder. This contains slightly modified separateObj node, which will now pass on single subcomponent curves.

4. Open nodeeditor canvas in MoI4Beta and load ConformalMapKagome01.nod.
Run this nod. (Some of the "extra" wires are disconnected.)

The curves will be generated piecemeal, and at least one continuous string will
have to be manually joined. There are some extra duplicate curve segments, which can be avoided.
Any additional copy rotates and trims of the torus surface are up to the user.

Additional unnecessary remarks:
(Using the get_by_style node (color "coral" as set up), the lines on the flat torus could be created and mapped and likely avoid the joining. (Yet to be tried.))
(The get_by_style input method needs miscellaneous curve/ line segments to be entered in quadrant I of the MoI4Beta screen, before loading the ConformalMapKagome01 node. (Also connect the disconnected wires.)

- Brian

Attachments:
Kagome2019.zip


From: bemfarmer
18 Feb 2019   [#36]
Here is a .nod file with a macro for the "TennisBallClosedCurve" on a sphere.
The parametric formula comes from the Paul Bourke site, but was modified to yield lobes from 1 on up. (credit to be revealed later.)
- Brian

Attachments:
TennisBallCurve.zip


Show messages:  1-16  17-36  37-45