background_straight_line_segments
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | background_straight_line_segments [2022/11/03 15:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Background, straight line segments - and a version 4 bug ====== | ||
+ | Many users want to draw their background; here's a way to connect points together to form a background using fit_obj' | ||
+ | |||
+ | <code topas> | ||
+ | { | ||
+ | prm !bkg_x_##n = x; | ||
+ | prm !bkg_y_##n = y; | ||
+ | } | ||
+ | macro Bkg_Straight_Line_First(n, | ||
+ | { | ||
+ | | ||
+ | } | ||
+ | macro Bkg_Straight_Line(n1, | ||
+ | { | ||
+ | | ||
+ | min_X >= bkg_x_##n1 + 1.0e-9; | ||
+ | #m_ifarg x2 " | ||
+ | max_X >= x2 + 1.0e-10; | ||
+ | #m_else | ||
+ | max_X <= x2 + 1.0e-10; | ||
+ | #m_endif | ||
+ | | ||
+ | }</ | ||
+ | |||
+ | Then graphically gather (x,y) points and form the straight line segments as follows: | ||
+ | |||
+ | <code topas> | ||
+ | |||
+ | Bkg_Straight_Line_First(0, | ||
+ | Bkg_Straight_Line(0, | ||
+ | Bkg_Straight_Line(1, | ||
+ | Bkg_Straight_Line(2, | ||
+ | Bkg_Straight_Line(3, | ||
+ | Bkg_Straight_Line(4, | ||
+ | Bkg_Straight_Line(5, | ||
+ | Bkg_Straight_Line(6, | ||
+ | Bkg_Straight_Line(7, | ||
+ | Bkg_Straight_Line(8, | ||
+ | Bkg_Straight_Line(9, | ||
+ | Bkg_Straight_Line(10, | ||
+ | |||
+ | This describes a background for the Y2O3a.INP file which can be found in the test_examples directory. | ||
+ | |||
+ | Note, in doing the above macros a bug in the interpretation of the >= and <= signs for min_X/max_X have been uncovered. The macros as defined above will work in version 4. Version 5 will have a different combination of the >=,<= signs and the macros would be inside of TOPAS.INC. | ||
+ | |||
+ | --- // |