2024-02-04 10:32 AM - last edited on 2024-09-26 01:22 PM by Doreena Deng
I have complex polygons managed as data using PUT.
In SPRISM we have multiple variables type: numeric and alfanumeric (material).
I need alfanumeric material due to the fact the Material (surface) is created in GDL and we can't extract an ID from a Material created in GDL using "IND (MATERIAL, name_string)"
PUT doesn't manage alfanumeric values.
Is there a way to insert multiple data (numeric and alfanumeric) in FPRISM with only one command such us "GET"?
I tried also to understand if "DICT" could work; but it seams it can't be used in SPRISM.
Thank you
SPRISM_{4} top_material, bottom_material, side_material, mask,
n,
xtb, ytb, xte, yte, topz, tangle,
xbb, ybb, xbe, ybe, bottomz, bangle,
x1, y1, s1, mat1,
...
xn, yn, sn, matn
!-------Example with "GET" but it doesn't work----
SPRISM_{4} top_material, bottom_material, side_material, mask,
n,
xtb, ytb, xte, yte, topz, tangle,
xbb, ybb, xbe, ybe, bottomz, bangle,
GET(NSP)
Solved! Go to Solution.
2024-02-04 03:45 PM
Try this.
I found out that if You put mat_1,mat_1, mat_2, mask, n ... it does not work. There should be at least 2 material definition for some reason.
!Inline material definitions
colorname="color_1"
define material colorname 2,.5,.5,.1
colorname="color_2"
define material colorname 2,.1,.5,.1
colorname="color_3"
define material colorname 2,.1,.5,.6
colorname="color_4"
define material colorname 2,.6,.1,.6
colorname="color_5"
define material colorname 2,.6,.1,.1
mat_1=IND (MATERIAL, "color_1")
mat_2=IND (MATERIAL, "color_2")
mat_3=IND (MATERIAL, "color_3")
mat_4=IND (MATERIAL, "color_4")
mat_5=IND (MATERIAL, "color_5")
j1=1!: top edge in line elimination.
j2=1!: bottom edge in line elimination.
j3=1!: side edge in line elimination.
mask = j1 + 2*j2 + 4*j3 + 8*j4
put 0, 0, 1, 0, 1, 0,
0, 0, 1, 0, 0, 0,
0, 0, 15, mat_1,
1, 0, 15, mat_2,
1, 1, 15, mat_3,
0, 1, 15, mat_4,
0, 0, -1, mat_5
SPRISM_{4} mat_1,mat_1, mat_2, mask, (nsp-12)*.25, get(nsp)
2024-02-04 03:45 PM
Try this.
I found out that if You put mat_1,mat_1, mat_2, mask, n ... it does not work. There should be at least 2 material definition for some reason.
!Inline material definitions
colorname="color_1"
define material colorname 2,.5,.5,.1
colorname="color_2"
define material colorname 2,.1,.5,.1
colorname="color_3"
define material colorname 2,.1,.5,.6
colorname="color_4"
define material colorname 2,.6,.1,.6
colorname="color_5"
define material colorname 2,.6,.1,.1
mat_1=IND (MATERIAL, "color_1")
mat_2=IND (MATERIAL, "color_2")
mat_3=IND (MATERIAL, "color_3")
mat_4=IND (MATERIAL, "color_4")
mat_5=IND (MATERIAL, "color_5")
j1=1!: top edge in line elimination.
j2=1!: bottom edge in line elimination.
j3=1!: side edge in line elimination.
mask = j1 + 2*j2 + 4*j3 + 8*j4
put 0, 0, 1, 0, 1, 0,
0, 0, 1, 0, 0, 0,
0, 0, 15, mat_1,
1, 0, 15, mat_2,
1, 1, 15, mat_3,
0, 1, 15, mat_4,
0, 0, -1, mat_5
SPRISM_{4} mat_1,mat_1, mat_2, mask, (nsp-12)*.25, get(nsp)
2024-02-04 04:26 PM
Fantastic, it works fine.
I thought the negative value was an indication of error; instead it is a real ID of the internal Material.
Thank you @Pertti Paasky
I solved many problems and I will have a large amount of flexibility for future codes!!