When writing macros that take wells as parameters, I've been finding myself repeatedly writing ugly code that references w.exit dir and (on Wombat) an ad hoc safe_direction(w) (down for odd numbered wells, up for even numbered wells).
It would be useful if we could have (as a value) a transformation that essentially put the well's exit pad at (0,0), made the exit direction east, and the safe direction north. That is, be able to pretend that all wells are like well #4. Then you could say
transformation t = // something based on w
using t { ... }
And have all code (statically) within the block take all coordinate expressions and 'row'/'col' attributes based on that transformation.
For specifying the transformation you'd have to be able to specify
the origin,
any rotation, and
any reflection.
Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 11, 2023 at 12:19 PM PST.
When writing macros that take wells as parameters, I've been finding myself repeatedly writing ugly code that references
w.exit dir
and (on Wombat) an ad hocsafe_direction(w)
(down for odd numbered wells, up for even numbered wells).It would be useful if we could have (as a value) a transformation that essentially put the well's exit pad at
(0,0)
, made the exit directioneast
, and the safe directionnorth
. That is, be able to pretend that all wells are likewell #4
. Then you could sayAnd have all code (statically) within the block take all coordinate expressions and 'row'/'col' attributes based on that transformation.
For specifying the transformation you'd have to be able to specify
Migrated from internal repository. Originally created by @EvanKirshenbaum on Feb 11, 2023 at 12:19 PM PST.