// // time: Wed Apr 24 07:57:48 1996 // // version: 3.0.0 (format), 3.1.0 (DX) // // // Begin MDF // MODULE UniformSample // CATEGORY Realization // DESCRIPTION Samples a field uniformly at points on a surface or within a volume // INPUT manifold; group or series or value list or string list; (none); the surface or volume to sample // INPUT density; integer; 100; approximate number of samples // OUTPUT samples; field; a set of samples of the field // End MDF // // comment: This macros samples the selected manifold at a set of more-or-less uniformly spaced samples on a surface of quads or within a volume of cubes. The parameter density, which is the approximate number of points that result, controls the spacing of the samples. The method by which the sample points are selected is different than that of Sample, which does not always produce a uniform distribution. The output of this macro is a set of unconnected positions. Any components in the original field manifold that are dependent on either positions or connections are mapped onto the resulting samples. In either case the dependency of the component in the output field will be dependent on the positions. // comment: (C) COPYRIGHT International Business Machines Corp. 1996. // comment: All Rights Reserved. // comment: Licensed Materials - Property of IBM // comment: // comment: Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of IBM not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. // comment: // comment: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IBM DOES NOT WARRANT AGAINST THE INFRINGMENT OF PATENTS, COPYRIGHT OR ANY OTHER INTELLECTUAL PROPERTY RIGHTS OF OTHERS. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, IS WITH YOU. // workspace: width = 655, height = 1283 // layout: snap = 0, width = 50, height = 50, align = UL // macro UniformSample( manifold ,density = 100 ) -> ( samples ) { // // node Input[1]: x = 82, y = 0, inputs = 0, label = Input // parameter: position = 1, name = 'manifold', value = ' ', descriptive = 0, description = 'the surface or volume to sample', required = 1, visible = 1 // UniformSample_Input_1_out_1 = manifold; // // node Inquire[6]: x = 7, y = 104, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "is group" // input[3]: visible = 0 // UniformSample_Inquire_6_out_1 = Inquire( UniformSample_Input_1_out_1, "is group", NULL ) [instance: 6, cache: 1]; // // node Inquire[15]: x = 67, y = 135, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "is compositefield" // input[3]: visible = 0 // UniformSample_Inquire_15_out_1 = Inquire( UniformSample_Input_1_out_1, "is compositefield", NULL ) [instance: 15, cache: 1]; // // node Compute[76]: x = 0, y = 211, inputs = 3, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$1 || !$0 ? 1 : 2" // expression: value = b || !a ? 1 : 2 // name[2]: value = a // name[3]: value = b // UniformSample_Compute_76_out_1 = Compute( "$1 || !$0 ? 1 : 2", UniformSample_Inquire_6_out_1, UniformSample_Inquire_15_out_1 ) [instance: 76, cache: 1]; // // node Select[2]: x = 177, y = 99, inputs = 3, label = Select // input[3]: visible = 1 // UniformSample_Select_2_out_1 = Select( UniformSample_Input_1_out_1, NULL, NULL ) [instance: 2, cache: 1]; // // node Switch[40]: x = 80, y = 285, inputs = 3, label = Switch // UniformSample_Switch_40_out_1 = Switch( UniformSample_Compute_76_out_1, UniformSample_Input_1_out_1, UniformSample_Select_2_out_1 ) [instance: 40, cache: 1]; // // node Inquire[5]: x = 7, y = 430, inputs = 3, label = Inquire // input[2]: defaulting = 0, visible = 1, type = 32, value = "is 3dpositions" // input[3]: visible = 0 // UniformSample_Inquire_5_out_1 = Inquire( UniformSample_Switch_40_out_1, "is 3dpositions", NULL ) [instance: 5, cache: 1]; // // node Mark[3]: x = 217, y = 422, inputs = 2, label = Mark // input[2]: defaulting = 0, visible = 1, type = 32, value = "positions" // UniformSample_Mark_3_out_1 = Mark( UniformSample_Switch_40_out_1, "positions" ) [instance: 3, cache: 1]; // // node ShowBox[3]: x = 270, y = 375, inputs = 1, label = ShowBox // output[2]: visible = 0 // UniformSample_ShowBox_3_out_1, UniformSample_ShowBox_3_out_2 = ShowBox( UniformSample_Switch_40_out_1 ) [instance: 3, cache: 1]; // // node Extract[1]: x = 363, y = 418, inputs = 2, label = Extract // input[2]: defaulting = 0, visible = 1, type = 32, value = "box" // UniformSample_Extract_1_out_1 = Extract( UniformSample_ShowBox_3_out_1, "box" ) [instance: 1, cache: 1]; // // node Select[3]: x = 330, y = 524, inputs = 3, label = Select // input[3]: visible = 1 // UniformSample_Select_3_out_1 = Select( UniformSample_Extract_1_out_1, NULL, NULL ) [instance: 3, cache: 1]; // // node Compute[77]: x = 0, y = 523, inputs = 2, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0+1" // expression: value = a+1 // name[2]: value = a // UniformSample_Compute_77_out_1 = Compute( "$0+1", UniformSample_Inquire_5_out_1 ) [instance: 77, cache: 1]; // // node Transmitter[24]: x = 89, y = 582, inputs = 1, label = three_d // three_d = UniformSample_Compute_77_out_1; // // node Receiver[224]: x = 416, y = 539, inputs = 1, label = three_d // UniformSample_Receiver_224_out_1 = three_d; // // node Select[5]: x = 499, y = 507, inputs = 3, label = Select // input[2]: defaulting = 0, visible = 1, type = 1, value = 3 // input[3]: visible = 1 // UniformSample_Select_5_out_1 = Select( UniformSample_Extract_1_out_1, 3, NULL ) [instance: 5, cache: 1]; // // node Select[4]: x = 582, y = 531, inputs = 3, label = Select // input[2]: defaulting = 0, visible = 1, type = 1, value = 7 // input[3]: visible = 1 // UniformSample_Select_4_out_1 = Select( UniformSample_Extract_1_out_1, 7, NULL ) [instance: 4, cache: 1]; // // node Switch[41]: x = 494, y = 582, inputs = 3, label = Switch // UniformSample_Switch_41_out_1 = Switch( UniformSample_Receiver_224_out_1, UniformSample_Select_5_out_1, UniformSample_Select_4_out_1 ) [instance: 41, cache: 1]; // // node Compute[75]: x = 210, y = 776, inputs = 5, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 ? [$1.x*abs(($3.z-$2.z)/($3.x-$2.x)), $1.y*abs(($3.z-$2.z)/($3.y-$2.y)), $1.z] : [$1.x*abs(($3.y-$2.y)/($3.x-$2.x)), $1.y]" // expression: value = a ? [b.x*abs((d.z-c.z)/(d.x-c.x)), b.y*abs((d.z-c.z)/(d.y-c.y)), b.z] : [b.x*abs((d.y-c.y)/(d.x-c.x)), b.y] // name[2]: value = a // name[3]: value = b // name[4]: value = c // name[5]: value = d // UniformSample_Compute_75_out_1 = Compute( "$0 ? [$1.x*abs(($3.z-$2.z)/($3.x-$2.x)), $1.y*abs(($3.z-$2.z)/($3.y-$2.y)), $1.z] : [$1.x*abs(($3.y-$2.y)/($3.x-$2.x)), $1.y]", UniformSample_Inquire_5_out_1, UniformSample_Mark_3_out_1, UniformSample_Select_3_out_1, UniformSample_Switch_41_out_1 ) [instance: 75, cache: 1]; // // node Unmark[3]: x = 325, y = 814, inputs = 2, label = Unmark // input[2]: defaulting = 0, visible = 1, type = 32, value = "positions" // UniformSample_Unmark_3_out_1 = Unmark( UniformSample_Compute_75_out_1, "positions" ) [instance: 3, cache: 1]; // // node Input[2]: x = 404, y = 814, inputs = 0, label = Input // parameter: position = 2, name = 'density', value = '100', descriptive = 0, description = 'approximate number of samples', required = 0, visible = 1 // UniformSample_Input_2_out_1 = density; // // node Sample[3]: x = 324, y = 911, inputs = 2, label = Sample // UniformSample_Sample_3_out_1 = Sample( UniformSample_Unmark_3_out_1, UniformSample_Input_2_out_1 ) [instance: 3, cache: 1]; // // node Mark[4]: x = 198, y = 949, inputs = 2, label = Mark // input[2]: defaulting = 0, visible = 1, type = 32, value = "positions" // UniformSample_Mark_4_out_1 = Mark( UniformSample_Sample_3_out_1, "positions" ) [instance: 4, cache: 1]; // // node Transmitter[25]: x = 357, y = 619, inputs = 1, label = low // low = UniformSample_Select_3_out_1; // // node Receiver[225]: x = 276, y = 949, inputs = 1, label = low // UniformSample_Receiver_225_out_1 = low; // // node Transmitter[26]: x = 577, y = 729, inputs = 1, label = high // high = UniformSample_Switch_41_out_1; // // node Receiver[226]: x = 373, y = 1069, inputs = 1, label = high // UniformSample_Receiver_226_out_1 = high; // // node Compute[78]: x = 169, y = 1107, inputs = 5, label = Compute // input[1]: defaulting = 0, visible = 0, type = 32, value = "$0 ? [$1.x*abs(($3.x-$2.x)/($3.z-$2.z)), $1.y*abs(($3.y-$2.y)/($3.z-$2.z)), $1.z] : [$1.x*abs(($3.x-$2.x)/($3.y-$2.y)), $1.y]" // expression: value = a ? [b.x*abs((d.x-c.x)/(d.z-c.z)), b.y*abs((d.y-c.y)/(d.z-c.z)), b.z] : [b.x*abs((d.x-c.x)/(d.y-c.y)), b.y] // name[2]: value = a // name[3]: value = b // name[4]: value = c // name[5]: value = d // UniformSample_Compute_78_out_1 = Compute( "$0 ? [$1.x*abs(($3.x-$2.x)/($3.z-$2.z)), $1.y*abs(($3.y-$2.y)/($3.z-$2.z)), $1.z] : [$1.x*abs(($3.x-$2.x)/($3.y-$2.y)), $1.y]", UniformSample_Inquire_5_out_1, UniformSample_Mark_4_out_1, UniformSample_Receiver_225_out_1, UniformSample_Receiver_226_out_1 ) [instance: 78, cache: 1]; // // node Unmark[4]: x = 214, y = 1215, inputs = 2, label = Unmark // input[2]: defaulting = 0, visible = 1, type = 32, value = "positions" // UniformSample_Unmark_4_out_1 = Unmark( UniformSample_Compute_78_out_1, "positions" ) [instance: 4, cache: 1]; // // node Output[1]: x = 309, y = 1220, inputs = 1, label = Output // parameter: position = 1, name = 'samples', value = ' ', descriptive = 0, description = 'a set of samples of the field', required = 0, visible = 1 // samples = UniformSample_Unmark_4_out_1; // network: end of macro body } UniformSample_Input_1_out_1 = NULL; UniformSample_Inquire_6_out_1 = NULL; UniformSample_Inquire_15_out_1 = NULL; UniformSample_Compute_76_out_1 = NULL; UniformSample_Select_2_out_1 = NULL; UniformSample_Switch_40_out_1 = NULL; UniformSample_Inquire_5_out_1 = NULL; UniformSample_Mark_3_out_1 = NULL; UniformSample_ShowBox_3_out_1 = NULL; UniformSample_Extract_1_out_1 = NULL; UniformSample_Select_3_out_1 = NULL; UniformSample_Compute_77_out_1 = NULL; UniformSample_Transmitter_24_out_1 = NULL; UniformSample_Receiver_224_out_1 = NULL; UniformSample_Select_5_out_1 = NULL; UniformSample_Select_4_out_1 = NULL; UniformSample_Switch_41_out_1 = NULL; UniformSample_Compute_75_out_1 = NULL; UniformSample_Unmark_3_out_1 = NULL; UniformSample_Input_2_out_1 = NULL; UniformSample_Sample_3_out_1 = NULL; UniformSample_Mark_4_out_1 = NULL; UniformSample_Transmitter_25_out_1 = NULL; UniformSample_Receiver_225_out_1 = NULL; UniformSample_Transmitter_26_out_1 = NULL; UniformSample_Receiver_226_out_1 = NULL; UniformSample_Compute_78_out_1 = NULL; UniformSample_Unmark_4_out_1 = NULL;