Jeff Hiller
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
17 oct. 2017, 14:17 UTC−4
Updated:
7 years ago
17 oct. 2017, 14:18 UTC−4
The simplest was to create a regular hexagon is to use the Polygon tool and to take advantage of the "range" operator and the "cos" and "sin" functions, as shown in the attached file, which also shows the corresponding model method.
From there you just need to add the randomness (i.e. scaling, rotation, center location).
Best,
Jeff
-------------------
Jeff Hiller
The simplest was to create a regular hexagon is to use the Polygon tool and to take advantage of the "range" operator and the "cos" and "sin" functions, as shown in the attached file, which also shows the corresponding model method.
From there you just need to add the randomness (i.e. scaling, rotation, center location).
Best,
Jeff
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
17 oct. 2017, 16:21 UTC−4
Dear Jeff,
Thanks a lot for your quick reply. I successfully created a polygon (pol1) and scaled it (sca1), But the code:
** model.component("comp1").geom("geom1").create("pol"+ind, "sca1")
**
leads to error.
How can I add randomness in center location ?
Dear Jeff,
Thanks a lot for your quick reply. I successfully created a polygon (pol1) and scaled it (sca1), But the code:
** model.component("comp1").geom("geom1").create("pol"+ind, "sca1")
**
leads to error.
How can I add randomness in center location ?
Jeff Hiller
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
17 oct. 2017, 17:27 UTC−4
You can change the location of the center of the polygon by modifying the expressions used for the x and y coordinates of its vertices.
It should be pretty straightforward but if you should need further assistance, please contact COMSOL's technical support team at support@comsol.com .
Best regards,
Jeff
-------------------
Jeff Hiller
You can change the location of the center of the polygon by modifying the expressions used for the x and y coordinates of its vertices.
It should be pretty straightforward but if you should need further assistance, please contact COMSOL's technical support team at support@comsol.com .
Best regards,
Jeff