-
Notifications
You must be signed in to change notification settings - Fork 1
/
machinetool_resource_schema9_exp.txt
5777 lines (4748 loc) · 171 KB
/
machinetool_resource_schema9_exp.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
SCHEMA combined_schema;
CONSTANT
dummy_tri : topological_representation_item := representation_item('')||
topological_representation_item();
dummy_gri : geometric_representation_item := representation_item('')||
geometric_representation_item();
END_CONSTANT;
(*SCHEMA support_resource_schema;*)
(* ************************************************************ *)
(* ************************************************************ *)
(* support_resource_schema ISO 10303-41 *)
(* Author: *)
(* Contact: *)
(* Version: 2000 *)
(* ************************************************************ *)
(* ************************************************************ *)
TYPE identifier = STRING;
END_TYPE;
TYPE label = STRING;
END_TYPE;
TYPE text = STRING;
END_TYPE;
FUNCTION bag_to_set
(the_bag : BAG OF GENERIC : intype) : SET OF GENERIC : intype;
LOCAL
the_set: SET OF GENERIC : intype := [];
END_LOCAL;
IF SIZEOF (the_bag) > 0 THEN
REPEAT i := 1 to HIINDEX (the_bag);
the_set := the_set + the_bag [i];
END_REPEAT;
END_IF;
RETURN (the_set);
END_FUNCTION;
(*
END_SCHEMA; (* support_resource_schema *)
*)
(*SCHEMA geometry_schema;*)
(* ************************************************************ *)
(* ************************************************************ *)
(* geometry_schema ISO 10303-42 *)
(* Author: *)
(* Contact: *)
(* Version: 2000 *)
(* ************************************************************ *)
(* ************************************************************ *)
(*
REFERENCE FROM support_resource_schema (
label
);
REFERENCE FROM geometric_model_schema
(
solid_model
);
REFERENCE FROM measure_schema (
length_measure,
parameter_value,
plane_angle_measure,
positive_ratio_measure,
positive_length_measure,
time_measure
);
REFERENCE FROM topology_schema
(
edge_curve,
face_surface,
poly_loop,
topological_representation_item,
vertex_point
);
REFERENCE FROM representation_schema
(
definitional_representation,
item_in_context,
representation,
representation_context,
representation_item,
using_representations
);
*)
(*
CONSTANT
dummy_tri : topological_representation_item := representation_item('')||
topological_representation_item();
dummy_gri : geometric_representation_item := representation_item('')||
geometric_representation_item();
END_CONSTANT;
*)
TYPE trimming_select = SELECT
(cartesian_point,
parameter_value);
END_TYPE;
TYPE trimming_preference = ENUMERATION OF
(cartesian, parameter, unspecified);
END_TYPE;
TYPE transition_code = ENUMERATION OF
(discontinuous,
continuous,
cont_same_gradient,
cont_same_gradient_same_curvature);
END_TYPE;
ENTITY trimmed_curve (* c0 *)
SUBTYPE OF (bounded_curve);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
basis_curve : curve;
trim_1 : SET[1:2] OF trimming_select;
trim_2 : SET[1:2] OF trimming_select;
sense_agreement : BOOLEAN;
master_representation : trimming_preference;
WHERE
WR1: ('MACHINING_SCHEMA.PARAMETER_VALUE' IN TYPEOF(trim_1[1])) OR
('MACHINING_SCHEMA.PARAMETER_VALUE' IN TYPEOF(trim_1[2]));
WR2: ('MACHINING_SCHEMA.PARAMETER_VALUE' IN TYPEOF(trim_2[1])) OR
('MACHINING_SCHEMA.PARAMETER_VALUE' IN TYPEOF(trim_2[2]));
WR3: ('MACHINING_SCHEMA.PARAMETER' IN TYPEOF(SELF.master_representation));
END_ENTITY;
ENTITY composite_curve (* c0 *)
SUBTYPE OF (bounded_curve);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
segments : LIST [1:?] OF composite_curve_segment;
self_intersect : LOGICAL;
DERIVE
n_segments : INTEGER := SIZEOF(segments);
closed_curve : LOGICAL
:= segments[n_segments].transition <> discontinuous;
WHERE
WR1: ((NOT closed_curve) AND (SIZEOF(QUERY(temp <* segments |
temp.transition = discontinuous)) = 1)) OR
((closed_curve) AND (SIZEOF(QUERY(temp <* segments |
temp.transition = discontinuous)) = 0));
END_ENTITY;
ENTITY composite_curve_segment; (* c0 *)
transition : transition_code;
same_sense : BOOLEAN;
parent_curve : curve;
INVERSE
using_curves : BAG [1:?] OF composite_curve FOR segments;
WHERE
WR1 : ('MACHINING_SCHEMA.BOUNDED_CURVE' IN
TYPEOF(parent_curve));
END_ENTITY;
TYPE b_spline_curve_form = ENUMERATION OF (polyline_form, circular_arc, elliptic_arc, parabolic_arc, hyperbolic_arc, unspecified);
END_TYPE;
TYPE b_spline_surface_form = ENUMERATION OF (plane_surf, cylindrical_surf, conical_surf, spherical_surf, toroidal_surf, surf_of_revolution, ruled_surf, generalised_cone, quadric_surf, surf_of_linear_extrusion, unspecified);
END_TYPE;
TYPE dimension_count = INTEGER;
WHERE
WR1: SELF > 0;
END_TYPE;
TYPE knot_type = ENUMERATION OF (uniform_knots, quasi_uniform_knots, piecewise_bezier_knots, unspecified);
END_TYPE;
TYPE pcurve_or_surface = SELECT (pcurve, surface);
END_TYPE;
TYPE vector_or_direction = SELECT (vector, direction);
END_TYPE;
ENTITY axis1_placement (* s1 *)
SUBTYPE OF (placement);
axis : OPTIONAL direction;
DERIVE
z : direction := NVL(normalise(axis), dummy_gri ||
direction([0.0,0.0,1.0]));
WHERE
WR1: SELF\geometric_representation_item.dim = 3;
END_ENTITY;
ENTITY axis2_placement_3d (* m0 *)
SUBTYPE OF (placement);
axis : OPTIONAL direction;
ref_direction : OPTIONAL direction;
DERIVE
p : LIST [3:3] OF direction := build_axes(axis, ref_direction);
WHERE
WR1: SELF\placement.location.dim = 3;
WR2: (NOT (EXISTS (axis))) OR (axis.dim = 3);
WR3: (NOT (EXISTS (ref_direction))) OR (ref_direction.dim = 3);
WR4: (NOT (EXISTS (axis))) OR (NOT (EXISTS (ref_direction))) OR
(cross_product(axis,ref_direction).magnitude > 0.0);
END_ENTITY;
ENTITY bezier_curve (* c1 *)
SUBTYPE OF (b_spline_curve);
END_ENTITY;
ENTITY bezier_surface (* s1 *)
SUBTYPE OF (b_spline_surface);
END_ENTITY;
ENTITY bounded_curve (* c0 *)
SUPERTYPE OF (ONEOF(polyline, b_spline_curve, trimmed_curve,
bounded_pcurve, composite_curve))
SUBTYPE OF (curve);
(* here the attribute name is missing. Therefore bounded_curve cannot be directly instantiated. *)
(* WZL-Parser does not support multiple inheritance, 03.06.2003 wj *)
END_ENTITY;
ENTITY bounded_pcurve (* s0 *)
SUBTYPE OF (pcurve, bounded_curve);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
WHERE
WR1: ('MACHINING_SCHEMA.BOUNDED_CURVE' IN
TYPEOF(SELF\pcurve.reference_to_curve.items[1]));
END_ENTITY;
ENTITY bounded_surface (* s0 *)
SUPERTYPE OF (b_spline_surface)
SUBTYPE OF (surface);
END_ENTITY;
ENTITY b_spline_curve (* c0 *)
SUPERTYPE OF (ONEOF(uniform_curve, b_spline_curve_with_knots,
quasi_uniform_curve, bezier_curve) ANDOR rational_b_spline_curve)
SUBTYPE OF (bounded_curve);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
degree : INTEGER;
control_points_list : LIST [2:?] OF cartesian_point;
curve_form: b_spline_curve_form;
closed_curve: LOGICAL;
self_intersect: LOGICAL;
DERIVE
upper_index_on_control_points : INTEGER
:= (SIZEOF(control_points_list) - 1);
control_points : ARRAY [0:upper_index_on_control_points]
OF cartesian_point
:= list_to_array(control_points_list,0,
upper_index_on_control_points);
WHERE
WR1: ('MACHINING_SCHEMA.UNIFORM_CURVE' IN TYPEOF(self)) OR
('MACHINING_SCHEMA.QUASI_UNIFORM_CURVE' IN TYPEOF(self)) OR
('MACHINING_SCHEMA.BEZIER_CURVE' IN TYPEOF(self)) OR
('MACHINING_SCHEMA.B_SPLINE_CURVE_WITH_KNOTS' IN TYPEOF(self));
END_ENTITY;
ENTITY b_spline_curve_with_knots (* c0 *)
SUBTYPE OF (b_spline_curve);
knot_multiplicities : LIST [2:?] OF INTEGER;
knots : LIST [2:?] OF parameter_value;
knot_spec : knot_type;
DERIVE
upper_index_on_knots : INTEGER := SIZEOF(knots);
WHERE
WR1: constraints_param_b_spline(degree, upper_index_on_knots,
upper_index_on_control_points,
knot_multiplicities, knots);
WR2: SIZEOF(knot_multiplicities) = upper_index_on_knots;
END_ENTITY;
ENTITY b_spline_surface (* s0 *)
SUPERTYPE OF (ONEOF(b_spline_surface_with_knots, uniform_surface,
quasi_uniform_surface, bezier_surface) ANDOR rational_b_spline_surface)
SUBTYPE OF (bounded_surface);
u_degree : INTEGER;
v_degree : INTEGER;
control_points_list : LIST [2:?] OF
LIST [2:?] OF cartesian_point;
surface_form : b_spline_surface_form;
u_closed : LOGICAL;
v_closed : LOGICAL;
self_intersect : LOGICAL;
DERIVE
u_upper : INTEGER := SIZEOF(control_points_list) - 1;
v_upper : INTEGER := SIZEOF(control_points_list[1]) - 1;
control_points : ARRAY [0:u_upper] OF ARRAY [0:v_upper] OF
cartesian_point
:= make_array_of_array(control_points_list,
0,u_upper,0,v_upper);
WHERE
WR1: ('MACHINING_SCHEMA.UNIFORM_SURFACE' IN TYPEOF(SELF)) OR
('MACHINING_SCHEMA.QUASI_UNIFORM_SURFACE' IN TYPEOF(SELF)) OR
('MACHINING_SCHEMA.BEZIER_SURFACE' IN TYPEOF(SELF)) OR
('MACHINING_SCHEMA.B_SPLINE_SURFACE_WITH_KNOTS' IN TYPEOF(SELF));
END_ENTITY;
ENTITY b_spline_surface_with_knots (* s0 *)
SUBTYPE OF (b_spline_surface);
u_multiplicities : LIST [2:?] OF INTEGER;
v_multiplicities : LIST [2:?] OF INTEGER;
u_knots : LIST [2:?] OF parameter_value;
v_knots : LIST [2:?] OF parameter_value;
knot_spec : knot_type;
DERIVE
knot_u_upper : INTEGER := SIZEOF(u_knots);
knot_v_upper : INTEGER := SIZEOF(v_knots);
WHERE
WR1: constraints_param_b_spline(SELF\b_spline_surface.u_degree,
knot_u_upper, SELF\b_spline_surface.u_upper,
u_multiplicities, u_knots);
WR2: constraints_param_b_spline(SELF\b_spline_surface.v_degree,
knot_v_upper, SELF\b_spline_surface.v_upper,
v_multiplicities, v_knots);
WR3: SIZEOF(u_multiplicities) = knot_u_upper;
WR4: SIZEOF(v_multiplicities) = knot_v_upper;
END_ENTITY;
ENTITY cartesian_point (* m0 c0 s0 *)
SUBTYPE OF (point);
coordinates : LIST [1:3] OF length_measure;
END_ENTITY;
ENTITY circle (* c1 *)
SUBTYPE OF (conic);
radius : positive_length_measure;
END_ENTITY;
ENTITY conic (* c1 *)
SUPERTYPE OF (ONEOF(circle, ellipse, hyperbola, parabola))
SUBTYPE OF (curve);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
position : axis2_placement_3d;
END_ENTITY;
ENTITY curve (* c0 *)
SUPERTYPE OF (ONEOF(line, conic, pcurve, bounded_curve))
SUBTYPE OF (geometric_representation_item);
(* attribute name is missing. Therfore curve should not be instantiated. Name has been shifted to the subtypes*)
(* WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
END_ENTITY;
ENTITY direction (* m0 *)
SUBTYPE OF (geometric_representation_item);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
direction_ratios : LIST [2:3] OF REAL;
WHERE
WR1: SIZEOF(QUERY(tmp <* direction_ratios | tmp <> 0.0)) > 0;
END_ENTITY;
ENTITY elementary_surface (* m0 s0 *)
SUPERTYPE OF (ONEOF(plane, spherical_surface))
SUBTYPE OF (surface);
position : axis2_placement_3d;
END_ENTITY;
ENTITY ellipse (* c1 *)
SUBTYPE OF (conic);
semi_axis_1 : positive_length_measure;
semi_axis_2 : positive_length_measure;
END_ENTITY;
ENTITY geometric_representation_context (* m0 *)
SUBTYPE OF (representation_context);
coordinate_space_dimension : dimension_count;
END_ENTITY;
ENTITY geometric_representation_item (* m0 *)
SUPERTYPE OF (ONEOF(point, direction, placement, curve, surface, edge_curve, face_surface, vertex_point, solid_model, poly_loop))
SUBTYPE OF (representation_item);
DERIVE
dim : dimension_count := dimension_of(SELF);
WHERE
WR1: SIZEOF (QUERY (using_rep <* using_representations (SELF) |
NOT ('MACHINING_SCHEMA.GEOMETRIC_REPRESENTATION_CONTEXT' IN
TYPEOF (using_rep.context_of_items)))) = 0;
END_ENTITY;
ENTITY hyperbola (* c1 *)
SUBTYPE OF (conic);
semi_axis : positive_length_measure;
semi_imag_axis : positive_length_measure;
END_ENTITY;
ENTITY line (* c1 *)
SUBTYPE OF (curve);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
pnt : cartesian_point;
dir : vector;
WHERE
WR1: dir.dim = pnt.dim;
END_ENTITY;
ENTITY oriented_surface (* c1 *)
SUBTYPE OF (surface);
orientation : BOOLEAN;
END_ENTITY;
ENTITY parabola (* c1 *)
SUBTYPE OF (conic);
focal_dist : length_measure;
WHERE
WR1: focal_dist <> 0.0;
END_ENTITY;
ENTITY pcurve (* s0 *)
SUBTYPE OF (curve);
(* here the attribute name is missing as we had to decide whether we use bounded_pcureve or pcurve *)
(* WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
basis_surface : surface;
reference_to_curve : definitional_representation;
WHERE
WR1: SIZEOF(reference_to_curve\representation.items) = 1;
WR2: 'MACHINING_SCHEMA.CURVE' IN TYPEOF
(reference_to_curve\representation.items[1]);
WR3: reference_to_curve\representation.items[1]\
geometric_representation_item.dim =2;
END_ENTITY;
ENTITY placement (* m0 *)
SUPERTYPE OF (axis2_placement_3d)
SUBTYPE OF (geometric_representation_item);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
location : cartesian_point;
END_ENTITY;
ENTITY plane (* m0 s0 *)
SUBTYPE OF (elementary_surface);
END_ENTITY;
ENTITY point (* m0 c0 s0 *)
SUPERTYPE OF (cartesian_point)
SUBTYPE OF (geometric_representation_item);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
END_ENTITY;
ENTITY polyline (* c0 *)
SUBTYPE OF (bounded_curve);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
points : LIST [2:?] OF cartesian_point;
END_ENTITY;
ENTITY quasi_uniform_curve (* c1 *)
SUBTYPE OF (b_spline_curve);
END_ENTITY;
ENTITY quasi_uniform_surface (* s1 *)
SUBTYPE OF (b_spline_surface);
END_ENTITY;
ENTITY rational_b_spline_curve (* c0 *)
SUBTYPE OF (b_spline_curve);
weights_data : LIST [2:?] OF REAL;
DERIVE
weights : ARRAY [0:upper_index_on_control_points] OF REAL
:= list_to_array(weights_data,0,upper_index_on_control_points);
WHERE
WR1: SIZEOF(weights_data) = SIZEOF(SELF\b_spline_curve.control_points_list);
WR2: curve_weights_positive(SELF);
END_ENTITY;
ENTITY rational_b_spline_surface (* s0 *)
SUBTYPE OF (b_spline_surface);
weights_data : LIST [2:?] OF LIST [2:?] OF REAL;
DERIVE
weights : ARRAY [0:u_upper] OF ARRAY [0:v_upper] OF REAL
:= make_array_of_array(weights_data,0,u_upper,0,v_upper);
WHERE
WR1: (SIZEOF(weights_data) = SIZEOF(SELF\b_spline_surface.control_points_list)) AND (SIZEOF(weights_data[1]) = SIZEOF(SELF\b_spline_surface.control_points_list[1]));
WR2: surface_weights_positive(SELF);
END_ENTITY;
ENTITY spherical_surface (* s1 *)
SUBTYPE OF (elementary_surface);
radius : positive_length_measure;
END_ENTITY;
ENTITY surface (* m0 s0 *)
SUPERTYPE OF (ONEOF(swept_surface, elementary_surface, bounded_surface, oriented_surface))
SUBTYPE OF (geometric_representation_item);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
END_ENTITY;
ENTITY surface_of_linear_extrusion (* s1 *)
SUBTYPE OF (swept_surface);
extrusion_axis : vector;
END_ENTITY;
ENTITY surface_of_revolution (* s1 *)
SUBTYPE OF (swept_surface);
axis_position : axis1_placement;
DERIVE
axis_line : line := dummy_gri || curve() || line (axis_position.location,
dummy_gri || vector(axis_position.z, 1.0));
END_ENTITY;
ENTITY swept_surface (* s1 *)
SUPERTYPE OF (ONEOF(surface_of_linear_extrusion, surface_of_revolution))
SUBTYPE OF (surface);
swept_curve : curve;
END_ENTITY;
ENTITY uniform_curve (* c1 *)
SUBTYPE OF (b_spline_curve);
END_ENTITY;
ENTITY uniform_surface (* s1 *)
SUBTYPE OF (b_spline_surface);
END_ENTITY;
ENTITY vector (* c1 s1 *)
SUBTYPE OF (geometric_representation_item);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
orientation : direction;
magnitude : length_measure;
WHERE
WR1 : magnitude >= 0.0;
END_ENTITY;
RULE compatible_dimension FOR (cartesian_point, direction, representation_context, geometric_representation_context);
WHERE
-- ensure that the count of coordinates of each cartesian_point
-- matches the coordinate_space_dimension of each geometric_context in
-- which it is geometrically founded
WR1: SIZEOF(QUERY(x <* cartesian_point| SIZEOF(QUERY
(y <* geometric_representation_context | item_in_context(x,y) AND
(HIINDEX(x.coordinates) <> y.coordinate_space_dimension))) > 0 )) =0;
-- ensure that the count of direction_ratios of each direction
-- matches the coordinate_space_dimension of each geometric_context in
-- which it is geometrically founded
WR2: SIZEOF(QUERY(x <* direction | SIZEOF( QUERY
(y <* geometric_representation_context | item_in_context(x,y) AND
(HIINDEX(x.direction_ratios) <> y.coordinate_space_dimension)))
> 0 )) = 0;
END_RULE;
FUNCTION build_axes(axis, ref_direction : direction): LIST [3:3] OF direction;
LOCAL
d1, d2 : direction;
END_LOCAL;
d1 := NVL(normalise(axis), dummy_gri || direction([0.0,0.0,1.0]));
d2 := first_proj_axis(d1, ref_direction);
RETURN([d2, normalise(cross_product(d1,d2)).orientation, d1]);
END_FUNCTION;
FUNCTION constraints_param_b_spline(degree, up_knots, up_cp : INTEGER;
knot_mult : LIST OF INTEGER;
knots : LIST OF parameter_value) : BOOLEAN;
LOCAL
result : BOOLEAN := TRUE;
k, sum : INTEGER;
END_LOCAL;
(* Find sum of knot multiplicities. *)
sum := knot_mult[1];
REPEAT i := 2 TO up_knots;
sum := sum + knot_mult[i];
END_REPEAT;
(* Check limits holding for all B-spline parametrisations *)
IF (degree < 1) OR (up_knots < 2) OR (up_cp < degree) OR
(sum <> (degree + up_cp + 2)) THEN
result := FALSE;
RETURN(result);
END_IF;
k := knot_mult[1];
IF (k < 1) OR (k > degree + 1) THEN
result := FALSE;
RETURN(result);
END_IF;
REPEAT i := 2 TO up_knots;
IF (knot_mult[i] < 1) OR (knots[i] <= knots[i-1]) THEN
result := FALSE;
RETURN(result);
END_IF;
k := knot_mult[i];
IF (i < up_knots) AND (k > degree) THEN
result := FALSE;
RETURN(result);
END_IF;
IF (i = up_knots) AND (k > degree + 1) THEN
result := FALSE;
RETURN(result);
END_IF;
END_REPEAT;
RETURN(result);
END_FUNCTION;
FUNCTION cross_product (arg1, arg2 : direction) : vector;
LOCAL
mag : REAL;
res : direction;
v1,v2 : LIST[3:3] OF REAL;
result : vector;
END_LOCAL;
IF ( NOT EXISTS (arg1) OR (arg1.dim = 2)) OR
( NOT EXISTS (arg2) OR (arg2.dim = 2)) THEN
RETURN(?);
ELSE
BEGIN
v1 := normalise(arg1).direction_ratios;
v2 := normalise(arg2).direction_ratios;
res := dummy_gri || direction([(v1[2]*v2[3] - v1[3]*v2[2]),
(v1[3]*v2[1] - v1[1]*v2[3]), (v1[1]*v2[2] - v1[2]*v2[1])]);
mag := 0.0;
REPEAT i := 1 TO 3;
mag := mag + res.direction_ratios[i]*res.direction_ratios[i];
END_REPEAT;
IF (mag > 0.0) THEN
result := dummy_gri || vector(res, SQRT(mag));
ELSE
result := dummy_gri || vector(arg1, 0.0);
END_IF;
RETURN(result);
END;
END_IF;
END_FUNCTION;
FUNCTION curve_weights_positive(b: rational_b_spline_curve) : BOOLEAN;
LOCAL
result : BOOLEAN := TRUE;
END_LOCAL;
REPEAT i := 0 TO b.upper_index_on_control_points;
IF b.weights[i] <= 0.0 THEN
result := FALSE;
RETURN(result);
END_IF;
END_REPEAT;
RETURN(result);
END_FUNCTION;
FUNCTION dimension_of(item : geometric_representation_item): dimension_count;
LOCAL
x : SET OF representation;
y : representation_context;
END_LOCAL;
-- Find the set of representation in which the item is used.
x := using_representations(item);
-- Determines the dimension_count of the
-- geometric_representation_context. Note that the
-- RULE compatible_dimension ensures that the context_of_items
-- is of type geometric_representation_context and has
-- the same dimension_count for all values of x.
-- The SET x is non-empty since this is required by WR1 of
-- representation_item.
y := x[1].context_of_items;
RETURN (y\geometric_representation_context.coordinate_space_dimension);
END_FUNCTION;
FUNCTION dot_product(arg1, arg2 : direction) : REAL;
LOCAL
scalar : REAL;
vec1, vec2: direction;
ndim : INTEGER;
END_LOCAL;
IF NOT EXISTS (arg1) OR NOT EXISTS (arg2) THEN
scalar := ?;
(* When function is called with invalid data an indeterminate result
is returned *)
ELSE
IF (arg1.dim <> arg2.dim) THEN
scalar := ?;
(* When function is called with invalid data an indeterminate result
is returned *)
ELSE
BEGIN
vec1 := normalise(arg1);
vec2 := normalise(arg2);
ndim := arg1.dim;
scalar := 0.0;
REPEAT i := 1 TO ndim;
scalar := scalar +
vec1.direction_ratios[i]*vec2.direction_ratios[i];
END_REPEAT;
END;
END_IF;
END_IF;
RETURN (scalar);
END_FUNCTION;
FUNCTION first_proj_axis(z_axis, arg : direction) : direction;
LOCAL
x_axis : direction;
v : direction;
z : direction;
x_vec : vector;
END_LOCAL;
IF (NOT EXISTS(z_axis)) THEN
RETURN (?) ;
ELSE
z := normalise(z_axis);
IF NOT EXISTS(arg) THEN
IF (z.direction_ratios <> [1.0,0.0,0.0]) THEN
v := dummy_gri || direction([1.0,0.0,0.0]);
ELSE
v := dummy_gri || direction([0.0,1.0,0.0]);
END_IF;
ELSE
IF (arg.dim <> 3) THEN
RETURN (?) ;
END_IF;
IF ((cross_product(arg,z).magnitude) = 0.0) THEN
RETURN (?);
ELSE
v := normalise(arg);
END_IF;
END_IF;
x_vec := scalar_times_vector(dot_product(v, z), z);
x_axis := vector_difference(v, x_vec).orientation;
x_axis := normalise(x_axis);
END_IF;
RETURN(x_axis);
END_FUNCTION;
FUNCTION list_to_array(lis : LIST [0:?] OF GENERIC : T; low,u : INTEGER) : ARRAY OF GENERIC : T;
LOCAL
n : INTEGER;
res : ARRAY [low:u] OF GENERIC : T;
END_LOCAL;
n := SIZEOF(lis);
IF (n <> (u-low +1)) THEN
RETURN(?);
ELSE
res := [lis[1] : n];
REPEAT i := 2 TO n;
res[low+i-1] := lis[i];
END_REPEAT;
RETURN(res);
END_IF;
END_FUNCTION;
FUNCTION make_array_of_array(lis : LIST[1:?] OF LIST [1:?] OF GENERIC : T; low1, u1, low2, u2 : INTEGER): ARRAY OF ARRAY OF GENERIC : T;
LOCAL
res : ARRAY[low1:u1] OF ARRAY [low2:u2] OF GENERIC : T;
END_LOCAL;
(* Check input dimensions for consistency *)
IF (u1-low1+1) <> SIZEOF(lis) THEN
RETURN (?);
END_IF;
IF (u2 - low2 + 1 ) <> SIZEOF(lis[1]) THEN
RETURN (?) ;
END_IF;
(* Initialise res with values from lis[1] *)
res := [list_to_array(lis[1], low2, u2) : (u1-low1 + 1)];
REPEAT i := 2 TO HIINDEX(lis);
IF (u2-low2+1) <> SIZEOF(lis[i]) THEN
RETURN (?);
END_IF;
res[low1+i-1] := list_to_array(lis[i], low2, u2);
END_REPEAT;
RETURN (res);
END_FUNCTION;
FUNCTION normalise (arg : vector_or_direction) : vector_or_direction;
LOCAL
ndim : INTEGER;
v : direction;
result : vector_or_direction;
vec : vector;
mag : REAL;
END_LOCAL;
IF NOT EXISTS (arg) THEN
result := ?;
(* When function is called with invalid data a NULL result is returned *)
ELSE
ndim := arg.dim;
IF 'MACHINING_SCHEMA.VECTOR' IN TYPEOF(arg) THEN
BEGIN
v := dummy_gri || direction(arg.orientation.direction_ratios);
IF arg.magnitude = 0.0 THEN
RETURN(?);
ELSE
vec := dummy_gri || vector (v, 1.0);
END_IF;
END;
ELSE
v := dummy_gri || direction (arg.direction_ratios);
END_IF;
mag := 0.0;
REPEAT i := 1 TO ndim;
mag := mag + v.direction_ratios[i]*v.direction_ratios[i];
END_REPEAT;
IF mag > 0.0 THEN
mag := SQRT(mag);
REPEAT i := 1 TO ndim;
v.direction_ratios[i] := v.direction_ratios[i]/mag;
END_REPEAT;
IF 'MACHINING_SCHEMA.VECTOR' IN TYPEOF(arg) THEN
vec.orientation := v;
result := vec;
ELSE
result := v;
END_IF;
ELSE
RETURN(?);
END_IF;
END_IF;
RETURN (result);
END_FUNCTION;
FUNCTION scalar_times_vector (scalar : REAL; vec : vector_or_direction)
: vector;
LOCAL
v : direction;
mag : REAL;
result : vector;
END_LOCAL;
IF NOT EXISTS (scalar) OR NOT EXISTS (vec) THEN
RETURN (?) ;
ELSE
IF 'MACHINING_SCHEMA.VECTOR' IN TYPEOF (vec) THEN
v := dummy_gri || direction(vec.orientation.direction_ratios);
mag := scalar * vec.magnitude;
ELSE
v := dummy_gri || direction(vec.direction_ratios);
mag := scalar;
END_IF;
IF (mag < 0.0 ) THEN
REPEAT i := 1 TO SIZEOF(v.direction_ratios);
v.direction_ratios[i] := -v.direction_ratios[i];
END_REPEAT;
mag := -mag;
END_IF;
result := dummy_gri || vector(normalise(v), mag);
END_IF;
RETURN (result);
END_FUNCTION;
FUNCTION surface_weights_positive(b: rational_b_spline_surface) : BOOLEAN;
LOCAL
result : BOOLEAN := TRUE;
END_LOCAL;
REPEAT i := 0 TO b.u_upper;
REPEAT j := 0 TO b.v_upper;
IF (b.weights[i][j] <= 0.0) THEN
result := FALSE;
RETURN(result);
END_IF;
END_REPEAT;
END_REPEAT;
RETURN(result);
END_FUNCTION;
FUNCTION vector_difference(arg1, arg2 : vector_or_direction) : vector;
LOCAL
result : vector;
res, vec1, vec2 : direction;
mag, mag1, mag2 : REAL;
ndim : INTEGER;
END_LOCAL;
IF ((NOT EXISTS (arg1)) OR (NOT EXISTS (arg2))) OR (arg1.dim <> arg2.dim)
THEN
RETURN (?) ;
ELSE
BEGIN
IF 'MACHINING_SCHEMA.VECTOR' IN TYPEOF(arg1) THEN
mag1 := arg1.magnitude;
vec1 := arg1.orientation;
ELSE
mag1 := 1.0;
vec1 := arg1;
END_IF;
IF 'MACHINING_SCHEMA.VECTOR' IN TYPEOF(arg2) THEN
mag2 := arg2.magnitude;
vec2 := arg2.orientation;
ELSE
mag2 := 1.0;
vec2 := arg2;
END_IF;
vec1 := normalise (vec1);
vec2 := normalise (vec2);
ndim := SIZEOF(vec1.direction_ratios);
mag := 0.0;
res := dummy_gri || direction(vec1.direction_ratios);
REPEAT i := 1 TO ndim;
res.direction_ratios[i] := mag1*vec1.direction_ratios[i] +
mag2*vec2.direction_ratios[i];
mag := mag + (res.direction_ratios[i]*res.direction_ratios[i]);
END_REPEAT;
IF (mag > 0.0 ) THEN
result := dummy_gri || vector( res, SQRT(mag));
ELSE
result := dummy_gri || vector( vec1, 0.0);
END_IF;
END;
END_IF;
RETURN (result);
END_FUNCTION;
(*
END_SCHEMA; (* geometry_schema *)
*)
(*SCHEMA topology_schema;*)
(* ************************************************************ *)
(* ************************************************************ *)
(* topology_schema ISO 10303-42 *)
(* Author: *)
(* Contact: *)
(* Version: 2000 *)
(* ************************************************************ *)
(* ************************************************************ *)
(*
REFERENCE FROM support_resource_schema (
label
);
REFERENCE FROM geometry_schema (
geometric_representation_item,
surface,
curve,
point,
cartesian_point,
dummy_tri
);
REFERENCE FROM representation_schema (
representation_item
);
REFERENCE FROM aic_topologically_bounded_surface (
advanced_face
);
REFERENCE FROM machining_schema (
topological_region (* TODO: ist das richtig???? *)
);
*)
TYPE list_of_reversible_topology_item = LIST [0:?] of reversible_topology_item;
END_TYPE;
TYPE set_of_reversible_topology_item = SET [0:?] of reversible_topology_item;
END_TYPE;
TYPE reversible_topology = SELECT (reversible_topology_item);
(*list_of_reversible_topology_item,*)
(*set_of_reversible_topology_item);*)
END_TYPE;
TYPE reversible_topology_item = SELECT (edge, path, face,
face_bound, closed_shell, open_shell);
END_TYPE;
TYPE shell = SELECT (open_shell, closed_shell);
END_TYPE;
ENTITY closed_shell (* t0 *)
SUBTYPE OF (connected_face_set);
END_ENTITY;
ENTITY connected_face_set (* t0 *)
SUPERTYPE OF (ONEOF(open_shell, closed_shell))
SUBTYPE OF (topological_representation_item);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
cfs_faces : SET [1:?] OF face;
END_ENTITY;
ENTITY edge (* t0 *)
SUPERTYPE OF(ONEOF(edge_curve, oriented_edge))
SUBTYPE OF (topological_representation_item);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
edge_start : vertex;
edge_end : vertex;
END_ENTITY;
ENTITY edge_curve (* t0 *)
SUBTYPE OF(edge, geometric_representation_item);
edge_geometry : curve;
same_sense : BOOLEAN;
END_ENTITY;
ENTITY edge_loop (* t0 *)
SUBTYPE OF (loop, path);
DERIVE
ne : INTEGER := SIZEOF(SELF\path.edge_list);
WHERE
WR1: (SELF\path.edge_list[1].edge_start) :=:
(SELF\path.edge_list[ne].edge_end);
END_ENTITY;
ENTITY face (* t0 *)
SUPERTYPE OF(ONEOF(face_surface, oriented_face))
SUBTYPE OF (topological_representation_item);
name : label; (*added as WZL-Parser does not support multiple inheritance, 02.06.2003 wj *)
bounds : SET[1:?] OF face_bound;
WHERE