Trying to investigate the reason of an overlap in the demo model (between the vacuum vessel and the blanket mainly) I realised that the order of the union argument list seems to matter. It shouldn't...
import paramak
rotation_angle = 2
blanket = paramak.RotateMixedShape(
points=[
(1028.5051619363035, -506.43908961374075, "spline"),
(1192.275810836831, -281.2815003658492, "spline"),
(1257.92101205376, -56.43827165248217, "spline"),
(1244.8344044363996, 216.28835367966997, "spline"),
(1153.671764932414, 400.5162013324601, "spline"),
(988.2423861054414, 520.3252882504712, "spline"),
(807.595124581199, 539.8030669696149, "spline"),
(670.5280987407093, 475.18311549274034, "spline"),
(584.8527692840913, 334.5130635036775, "spline"),
(574.292831670967, 81.767193745908, "spline"),
(579.3751030153657, -158.89465706473618, "spline"),
(580.3587684368622, -363.4679185119577, "straight"),
(686.29567682058, -355.1059282936036, "spline"),
(657.9911865059497, -182.71061116031922, "straight"),
(657.4125597874224, -62.3733985443065, "straight"),
(656.6796326106211, 90.05373743597613, "straight"),
(671.3960388185003, 294.67729656872143, "spline"),
(725.9412508183462, 379.089387299264, "spline"),
(804.2487333923825, 419.4532799322212, "spline"),
(1036.1333908422225, 356.0153240651591, "spline"),
(1095.4908483844877, 255.92292987253006, "spline"),
(1127.4889059190507, 131.6750722070317, "spline"),
(1128.4147086686944, -60.864467978588436, "spline"),
(1082.0859960719372, -221.46497785651047, "spline"),
(945.6554596218276, -418.4558632109989, "straight"),
],
rotation_angle=rotation_angle,
stp_filename="blanket.stp",
stl_filename="blanket.stl",
material_tag="blanket_mat",
color=(0., 1., 0.498),
)
# SN Divertor
divertor = paramak.RotateMixedShape(
points=[
(580.3587684368622, -363.4679185119577, "straight"),
(678.5035036777448, -367.1647983979668, "straight"),
(698.2057434436014, -383.14688797319684, "straight"),
(706.2100797165632, -415.21166249470514, "straight"),
(698.4950568028651, -443.3154942812033, "straight"),
(694.7436269110794, -479.42923248738805, "straight"),
(690.8764716755882, -491.47552817037024, "straight"),
(726.2209203989679, -495.3735987984752, "straight"),
(745.6917094774136, -463.22080332730013, "straight"),
(769.222529364193, -459.1341163784806, "straight"),
(788.8861940154811, -467.093725112643, "straight"),
(808.5691462240535, -479.0645742673395, "straight"),
(863.866572957985, -551.0908599376131, "straight"),
(891.3995609812453, -563.0365602495477, "straight"),
(895.1702784303153, -530.9340624638968, "straight"),
(883.2602118072937, -502.8931027843033, "straight"),
(886.9923541417953, -462.76812415758457, "straight"),
(945.6554596218276, -418.4558632109989, "straight"),
(1028.5051619363035, -506.43908961374075, "straight"),
(985.8893041167635, -622.9033804444106, "straight"),
(946.7548503870296, -647.096567181423, "straight"),
(801.5291878153039, -647.5618207725194, "straight"),
(675.5814387491815, -575.7618746871029, "straight"),
(612.3761135287094, -491.72701659798975, "straight"),
(584.5345245889013, -415.60146955751554, "straight"),
],
rotation_angle=rotation_angle,
stp_filename="divertor.stp",
stl_filename="divertor.stl",
material_tag="divertor_mat",
color=(1., 0.667, 0.),
)
# Vacuum vessel
inner_points = [
(574.1267649651465, 101.10991818268735),
(578.248235352396, 276.2517419573795),
(576.2157294079991, 183.80759081183805),
(574.6913499497014, 165.8825455403886),
(592.9839034492745, 356.1350119397756),
(618.3902277542372, 410.1718551122461),
(660.0565996143763, 462.707847631295),
(711.8855011965004, 503.98791778753997),
(763.7144027786246, 528.2384308674821),
(800.8076362638702, 535.0747131490673),
(957.8187204685404, 529.1614255259608),
(1009.6476220506645, 511.7304778365887),
(1061.4765236327887, 484.3593637684569),
(1113.3054252149127, 445.67421552338743),
(1160.0530619360443, 396.81085941923095),
(1196.1300424490914, 343.45306647581924),
(1221.5363667540544, 290.06656753580216),
(1239.3207937675284, 234.97736402844578),
(1251.5158294339103, 177.39960361334886),
(1259.8999164545482, 119.15248445488135),
(1262.8978627225338, 91.48061850063345),
(1257.7636381996099, -69.66392221833257),
(1248.4670705173148, -117.9739684683608),
(1236.2720348509329, -162.39122749437956),
(1219.5038608096575, -215.31064328924913),
(1198.1625483934886, -267.65634357273507),
(1171.7399711163273, -320.87421415048993),
(1140.7442554642726, -372.27816805066277),
(1102.6347690068283, -425.0006755712611),
(1058.9358912022924, -476.2931568156555),
(1022.8589106892452, -523.1641842564957),
(998.4688393564809, -582.3229466099988),
(961.8837323573345, -633.8322193152558),
(788.1044741113889, -641.8422854712626),
(746.4381022512498, -626.4054742155761),
(694.6092006691258, -595.170356965071),
(646.3371844896964, -549.174826941633),
(610.7683304627485, -496.43258230780384),
(588.9188915604805, -442.35157799696844),
(578.1466100551762, -383.4976698929381),
(577.6991331872189, -343.8423522802541),
(576.2157294079991, -254.96634344146696),
(576.2157294079991, -201.97055742152952),
(576.2157294079991, -148.97477140159208),
(576.2157294079991, -95.97898538165487),
]
vac_vessel_1 = paramak.RotateStraightShape(
points=inner_points,
rotation_angle=rotation_angle,
# avoid overlap between VV and blanket divertor
union=[divertor, blanket],
material_tag="vacuum_vessel_inner_mat",
stp_filename='vacvesselinner.stp',
stl_filename='vacvesselinner.stl',
)
vac_vessel_2 = paramak.RotateStraightShape(
points=inner_points,
rotation_angle=rotation_angle,
# avoid overlap between VV and blanket divertor
union=[blanket, divertor],
material_tag="vacuum_vessel_inner_mat",
stp_filename='vacvesselinner.stp',
stl_filename='vacvesselinner.stl',
)
print(vac_vessel_1.volume)
# 20844066.514337115
print(vac_vessel_2.volume)
# 20844063.839064926
On the image we can see there are bits that are different but these two shapes should be exactly the same...