2023-05-19 08:03 PM - last edited on 2023-05-20 03:45 AM by Karl Ottenstein
I feel like a total idiot for asking, but I'm trying to script a shape that is basically a rectangle with rounded ends. Using the CPRISM_ (or PRISM_) command, I have the following:
CPRISM_ materialAttribute_1, materialAttribute_1, materialAttribute_1,
7,.393701",
0,0,15,
1.73228",0,15,
1.73228",.433071",900,
1.73228",.866142",3015,
0,.866142",15,
0,.433071",900,
0,0,3015
what I am getting is a convex end on one side and a concave end on the other. It's showing as: (_( instead of (_)
I'm sure it has something to do with the second 900 status code, but can't figure out what that needs to be to be orientated correctly.
I am also getting a warning:"Undefined arc at line 50 of the 3d script"
Line 50 is the CPRISM_ materialAttri... line; what needs to be defined there to eliminate this warning?
Again, sorry for the basic stupid scripting question. Hoping someone can see this and correct my (probably obvious) error soon. THANKS!
Solved! Go to Solution.
2023-05-19 08:24 PM - edited 2023-05-19 08:27 PM
looks like a rounding error, since you doing a 180deg arc gdl gets confused as to whicj direction to go. you have 2 options:
1: you add a slight gap on the end of the second arc to be less that 180deg
CPRISM_ materialAttribute_1, materialAttribute_1, materialAttribute_1,
7,.393701,
0,0,15,
1.73228,0,15,
1.73228,.433071,900,
1.73228,.866142,3015,
0,.866142,15,
0,.433071,900,
-.0001,0,3015
2: (Better solution) you use the tangential arc by radius and angle which will ensure that the arc is always in the right direction
CPRISM_ materialAttribute_1, materialAttribute_1, materialAttribute_1,
6,.393701,
0,0,15,
1.73228,0,15,
1.73228,.433071,900,
1.73228,.866142,3015,
0,.866142,15,
.433071,180,2015
you also have some quotes at the end of some coordinates that you should remove (probably the reason for the undefined arc error)
also, not necessary but you should use variables instead of hard coded values when doing gdl. Allows to adjust the object later and make it reusable.
2023-05-19 08:24 PM - edited 2023-05-19 08:27 PM
looks like a rounding error, since you doing a 180deg arc gdl gets confused as to whicj direction to go. you have 2 options:
1: you add a slight gap on the end of the second arc to be less that 180deg
CPRISM_ materialAttribute_1, materialAttribute_1, materialAttribute_1,
7,.393701,
0,0,15,
1.73228,0,15,
1.73228,.433071,900,
1.73228,.866142,3015,
0,.866142,15,
0,.433071,900,
-.0001,0,3015
2: (Better solution) you use the tangential arc by radius and angle which will ensure that the arc is always in the right direction
CPRISM_ materialAttribute_1, materialAttribute_1, materialAttribute_1,
6,.393701,
0,0,15,
1.73228,0,15,
1.73228,.433071,900,
1.73228,.866142,3015,
0,.866142,15,
.433071,180,2015
you also have some quotes at the end of some coordinates that you should remove (probably the reason for the undefined arc error)
also, not necessary but you should use variables instead of hard coded values when doing gdl. Allows to adjust the object later and make it reusable.
2023-05-19 09:00 PM
That got me what I needed! thanks!
the hard coded parameters are only because this is a manufacturers object. Typically I'd allow for it to be adjustable... well, technically, I would typically just model it with a morph and save as object for somethign stupid simple like this...
2023-05-20 03:52 AM
@julienK wrote:
you also have some quotes at the end of some coordinates that you should remove (probably the reason for the undefined arc error)
The double quotes are likely because those values are in inches (imperial), vs default/internal meters (no quotes) since 4dProof is a USA user. The GDL interpreter does convert inch quantities to the corresponding metric value within scripts.
2023-05-20 06:45 AM
I didn"t know that. Explains why i got weird results when trying to fix it.