Jeff Hiller
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
7 years ago
Oct 17, 2017, 2:17 p.m. EDT
Updated:
7 years ago
Oct 17, 2017, 2:18 p.m. EDT
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
Oct 17, 2017, 4:21 p.m. EDT
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
Oct 17, 2017, 5:27 p.m. EDT
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