-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
566 lines (547 loc) · 20.3 KB
/
main.cpp
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
// Model.cpp : Defines the entry point for the console application.
//
#include "part.h"
#include "order.h"
#include <regex>
#include<stdlib.h>
#include<cmath>
#include<at_pos.hxx>
#include<at_vec.hxx>
#include <heal_api.hxx>
#include <insanity_list.hxx>
#include <stchapi.hxx>
//#include <tolerize_ent.hxx>
//#include <cover_options.hxx>
//#include<coverapi.hxx>
//#include "ACISModel.h"
//#include "all_h.h"
//#define FLAG ("FQHWIFBSCIEWFBSHFfhkFNEWIQUFBDA1343421312SFWFIFINFKASFHSDAFEWFFCE")
using namespace std;
void testModel(){
Part part;
part.Draw("D:\\Documents\\FMT\\FMT-5.5\\release\\test_path\\uselib\\result.nps",
"C:\\Users\\Jonathan_Lewis\\Desktop\\new\\","D:\\Documents\\FMT\\FMT-5.5\\release\\test_path\\uselib");
}
void testFuns(){
unlock_spatial_products_2541();
InitACIS();
void testImport();
testImport();
AcisModelExit();
}
int main()
{
int testM = 0;
//这是常规项,用以测试model.exe
if(testM)
testModel();
//下面是测试各种函数的,可以注释掉
else
testFuns();
return 0;
}
void testImport(){
ENTITY_LIST list,list1;
if(! ReadSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\new\\cone.sat",list)){
cout<<"未找到部件"<<endl;
}
ATTRIB_GEN_NAME *na;
api_find_named_attribute(list[0],"名称",na);
if(!na) {
cout<<"未保存名称属性"<<endl;
return;
}
ATTRIB_GEN_STRING *NAME = (ATTRIB_GEN_STRING *)na;
std::string name = NAME->value();
for(int i = 0; i <= 1; ++i){
//ENTITY* copy = new ENTITY(*list[0]);//这句话仿佛有问题,不能用复制构造函数?
ENTITY* copy;
/*list.add(list[0]);
ENTITY* copy = list[i];*/
api_copy_entity(list[0],copy);
if(i != 0){//i不等于0的,
//list.add(list[0]);
//ENTITY* copy = list[i];
char num = i + '0';
std::string copyName = name + '_' + num;
api_remove_generic_named_attribute(copy,"名称");
api_add_generic_named_attribute(copy,"名称",copyName.c_str(),SplitKeep,MergeKeepKept,TransApply,CopyCopy,(AcisOptions *)0);
ATTRIB_GEN_NAME *NA1;
api_find_named_attribute(copy,"名称",NA1);
cout<<((ATTRIB_GEN_STRING*)NA1)->value()<<endl;
api_find_named_attribute(copy,"材料",NA1);
cout<<((ATTRIB_GEN_STRING*)NA1)->value()<<endl;
api_find_named_attribute(copy,"S1:pos",NA1);
cout<<((ATTRIB_GEN_POSITION*)NA1)->value().x()<<endl;
}
list1.add(copy);
}
SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\testImport.sat",list1);
}
void testStich(){
ENTITY_LIST list;
ReadSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\new\\testCircle2.sat",list);
ENTITY_LIST r,o ;
//api_merge_seam_edges((BODY*)list[0]);
//api_merge_faces((BODY*)list[0],0);
//api_stitch((BODY*)list[0],(BODY*)list[0],TRUE);
/*api_clean_bodyapi_regularise_entityBODY*)list[0]);
(((list[0]);
api_clean_entity(list[0]);*/
//api_convert_to_spline(list[0],l);
//list.remove(list[0]);
//list.add(l);
tolerant_stitch_options sopts;
STITCH_COIN_MODES mode = SPASTITCH_COIN_STITCH;
sopts.set_stch_coincident_face_handling_mode(mode);
//stitch_options*sopts1 = new stitch_options(sopts);
api_stitch(list,o,r,&sopts);
SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\testCircle2.sat",r);
}
//
void testEllipsoid(){
BODY* sphere1,*sphere,*bool_body;
//api_set_int_option( "new_periodic_splitting", 3 );
//api_solid_sphere(SPAposition(0,0,0),5,sphere);//这里不是原点的圆心的话,后面拉伸,椭圆心会移动
api_solid_sphere(SPAposition(0,0,0),10,sphere1);
//api_transform_entity(sphere,scale_transf(1,1,2));
//SPAtransf x = scale_transf(0.5,0.5,1);
//TRANSFORM * y = new TRANSFORM(x);
//api_change_body_trans( sphere1, y) ;
api_transform_entity(sphere1,scale_transf(0.5,0.5,1));
//api_transform_entity(sphere1,rotate_transf(180,SPAvector(0,1,0)));
//api_change_body_trans( sphere1, NULL ) ;
api_merge_seam_edges(sphere1);
//api_boolean(sphere, sphere1, UNION, NDBOOL_KEEP_NEITHER, bool_body);
//api_initialize_healing();
//api_hh_init_body_for_healing(sphere1);
//api_hh_auto_heal(sphere1);
//api_hh_end_body_for_healing(sphere1);
//api_terminate_healing();
ENTITY_LIST pModelEntityList,p1,p2;
/*p1.init();
pModelEntityList.init();
p2.init();
p1.add(sphere1);
api_initialize_stitching();
exact_stitch_options *sopt = new exact_stitch_options;
api_stitch(p1,pModelEntityList,p2,sopt);
api_terminate_stitching();
sphere1->*/
/*insanity_list *list;
api_check_entity(sphere1,list);
cout<<list->count();
FILE * fp;
fp=fopen("C:\\Users\\Jonathan_Lewis\\Desktop\\error.txt","r");
list->print_messages(fp);*/
pModelEntityList.init();
//pModelEntityList.add(sphere);
pModelEntityList.add(sphere1);
//pModelEntityList.add(bool_body);
SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\testEllipsoid1.sat",pModelEntityList);
}
//在部件ent里面寻找名为facename的面,返回其法向量和中心点坐标
//void find_face(string facename,ENTITY* ent, SPAvector & facevec,SPAposition & facepos){
// ATTRIB_GEN_NAME *na;
//
// string vec_name = facename+":vec";
// api_find_named_attribute(ent,vec_name.c_str(),na);
// ATTRIB_GEN_VECTOR* vec=(ATTRIB_GEN_VECTOR*)na;
// if(na == NULL){
// cout<<"未找到面"<<facename<<"的法向量"<<endl;
// return;
// }
// cout<<na->name()<<endl;
// facevec=vec->value();
// cout<<"("<<vec->value().x()<<","<<vec->value().y()<<","<<vec->value().z()<<")"<<endl;
//
// string pos_name = facename+":pos";
// api_find_named_attribute(ent,pos_name.c_str(),na);
// if(na == NULL){
// cout<<"未找到面"<<facename<<"的中心点坐标"<<endl;
// return;
// }
// cout<<na->name()<<endl;
// ATTRIB_GEN_POSITION* pos=(ATTRIB_GEN_POSITION*)na;
// facepos=pos->value();
// cout<<"("<<pos->value().x()<<","<<pos->value().y()<<","<<pos->value().z()<<")"<<endl;
//}
//
//SPAvector cross_product(SPAvector a,SPAvector b){//计算三维矢量积
// double x,y,z;
// x=a.y()*b.z()-b.y()*a.z();
// y=-(a.x()*b.z()-a.z()*b.x());
// z=a.x()*b.y()-a.y()*b.x();
// return SPAvector(x,y,z);
//}
//
//double vector_angle(SPAvector a,SPAvector b){//计算矢量夹角
// double a_;
// a_=sqrt(a.x()*a.x()+a.y()*a.y()+a.z()*a.z());
// double b_=sqrt(b.x()*b.x()+b.y()*b.y()+b.z()*b.z());
// double theta = acos((a.x()*b.x()+a.y()*b.y()+a.z()*b.z())/(a_*b_));
// return theta;
//}
/*计算点orig绕经过原点的矢量axis,逆时针旋转弧度theta后的点坐标,
参考文章https://blog.csdn.net/gamesdev/article/details/9929211
和https://blog.csdn.net/qiuchangyong/article/details/5859628*/
//SPAposition rotated_pos(SPAposition orig,SPAvector axis,double angle){
// double c=cos(angle);
// double s=sin(angle);
// double x0=orig.x();
// double y0=orig.y();
// double z0=orig.z();
// //cout<<"("<<axis.x()<<","<<axis.y()<<","<<axis.z()<<")"<<endl;
// SPAvector unit_axis=axis/sqrt(axis.x()*axis.x()+axis.y()*axis.y()+axis.z()*axis.z());//单位化axis矢量
// double i=unit_axis.x();
// double j=unit_axis.y();
// double k=unit_axis.z();
// //cout<<"("<<i<<","<<j<<","<<k<<")"<<endl;
// double x1= ((1-c)*i*i+c)*x0+((1-c)*i*j-s*k)*y0+((1-c)*i*k+s*j)*z0;
// double y1=((1-c)*i*j+s*k)*x0+((1-c)*j*j+c)*y0+((1-c)*j*k-s*i)*z0;
// double z1=((1-c)*i*k-s*j)*x0+((1-c)*j*k+s*i)*y0+((1-c)*k*k+c)*z0;
// return SPAposition(x1,y1,z1);
//}
//void test_attrib(){
// BODY* cyl;
// SPAposition A(0,0,0),B(0,4,5);
// api_solid_cylinder_cone(A,B,2.5,3,2.5,NULL,cyl);
// ENTITY_LIST pModelEntityList;
// pModelEntityList.init();
// pModelEntityList.add(cyl);
// api_add_generic_named_attribute(cyl,"S1:pos",A);
// api_add_generic_named_attribute(cyl,"S1:vec",B-A);
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\cyl.sat",pModelEntityList);
//
// BODY* cone;
// SPAposition C(0,0,0),D(0,6,3);
// api_solid_cylinder_cone(C,D,5,4,0,NULL,cone);
// pModelEntityList.clear();
// pModelEntityList.add(cone);
// api_add_generic_named_attribute(cone,"S1:pos",C);
// api_add_generic_named_attribute(cone,"S1:vec",D-C);
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\cone.sat",pModelEntityList);
//
// ENTITY_LIST list;
// //ENTITY* ent;
// //ATTRIB* att;
// ReadSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\cyl.sat",list);
// ReadSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\cone.sat",list);
// SPAvector cylV,coneV;
// SPAposition cylP,coneP;
// find_face("S1",list[0],cylV,cylP);
// find_face("S1",list[1],coneV,coneP);
// //让圆锥的S1面跟圆柱的S1面共面,法向量相反
// //coordinate_transf(cylP,)
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\before_trans.sat",list);
//
// //bool reverse=true;//共面的时候,法向量方向相同还是相反,默认相反
// double angle=vector_angle(cylV,-coneV);
// SPAvector axis=cross_product(cylV,coneV);
// api_transform_entity(list[1],rotate_transf(angle,axis));//法向量相反(coneV=-coneV则法向量同向)
// api_transform_entity(list[1],translate_transf(cylP-rotated_pos(coneP,axis,angle)));//将两个面的中心点移至同一个地方
//
// api_add_generic_named_attribute(list[1],"S1:pos",cylP);
// api_add_generic_named_attribute(list[1],"S1:vec",-cylV);
// //cout<<vector_angle(cylV,coneV)<<endl<<cross_product(cylV,coneV).x()<<cross_product(cylV,coneV).y()<<cross_product(cylV,coneV).z();
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\trans.sat",list);
//}
//}
//void test_assem(){
// ENTITY_LIST list;
// ReadSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\new\\assem.sat",list); //这个list是这样的:sat里面有几个单独的body,list就有多少个ENTITY
// ATTRIB_GEN_NAME *na;
// api_find_named_attribute(list[1],"名称",na);
// ATTRIB_GEN_STRING *v=(ATTRIB_GEN_STRING *)na;
// string val=v->value();
// api_find_named_attribute(list[0],"材料",na);
// v=(ATTRIB_GEN_STRING *)na;
// val=v->value();
// vector<vector<int> > l;
// l.size();
// l[0].size();
//
// }
//void split_number(string line, vector<double> &split) {
// const regex num_pattern("\\S+");
// smatch s;
// while(std::regex_search(line,s,num_pattern)){
// split.push_back(std::atof(s[0].str().c_str()));
// line=s.suffix().str();
// //cout<<line<<" ;\n";
// }
//}
//void read_data()
//{
// ifstream MeshVertex,MeshDisp,MeshRegion;
// MeshVertex.open("D:\\Documents\\graduate2\\mesh\\Cylinder\\MeshVertex.txt",ios::in);
// MeshDisp.open("D:\\Documents\\graduate2\\mesh\\Cylinder\\MeshDisplacement.txt",ios::in);
// MeshRegion.open("D:\\Documents\\graduate2\\mesh\\Cylinder\\MeshRegion.txt",ios::in);
// MeshVertex.seekg(0,ios::beg);
// MeshDisp.seekg(0,ios::beg);
// MeshRegion.seekg(0,ios::beg);
// string line,lineD;
// if(!MeshVertex || !MeshRegion){
// cerr<<"文件打开失败!"<<endl;
// abort();
// }
// vector<double> x,y,z;
// while(!MeshVertex.eof()){
// getline(MeshVertex,line);//这个地方后续需要验证line符合格式
// vector<double> split,splitD;
// split_number(line,split);
// if(MeshDisp){
// getline(MeshDisp,lineD);
// split_number(lineD,splitD);
// x.push_back(split[0]+splitD[0]);//这个地方后续续验证索引没有溢出
// y.push_back(split[1]+splitD[1]);
// z.push_back(split[2]+splitD[2]);
// }
// else {
// x.push_back(split[0]);
// y.push_back(split[1]);
// z.push_back(split[2]);
// }
// //cout<<x.back()<<" "<<y.back()<<" "<<z.back()<<endl;
// }
// if(MeshDisp)
// MeshDisp.close();
// MeshVertex.close();
//
// ENTITY_LIST pModelEntityList;
// pModelEntityList.init();
// while(!MeshRegion.eof()){
// getline(MeshRegion,line);
// vector<double> splitR;//splitR 存放了一个网格的四个点的索引
// split_number(line,splitR);
//
// SPAposition A(x[splitR[0]],y[splitR[0]],z[splitR[0]]);
// SPAposition B(x[splitR[1]],y[splitR[1]],z[splitR[1]]);
// SPAposition C(x[splitR[2]],y[splitR[2]],z[splitR[2]]);
// SPAposition D(x[splitR[3]],y[splitR[3]],z[splitR[3]]);
//
// /*SPAposition B1(x[splitR[1]],y[splitR[1]]+0.005,z[splitR[1]]);
// SPAposition C1(x[splitR[2]],y[splitR[2]]+0.005,z[splitR[2]]);
// SPAposition D1(x[splitR[3]],y[splitR[3]]+0.005,z[splitR[3]]);*/
//
// /*cout<<A.x()<<A.y()<<A.z()<<endl;
// cout<<B.x()<<B.y()<<B.z()<<endl;
// cout<<C.x()<<C.y()<<C.z()<<endl;
// cout<<D.x()<<D.y()<<D.z()<<endl;*/
// BODY* point_body,*line_body/*,*line_body1,*line_body2,*line_body3*/;
// EDGE** triangle = new EDGE*[3];
// //EDGE* curve;
// SPAposition pts[1]={A};
// api_build_wire(NULL,FALSE,1,pts,NULL,point_body);
//
// api_curve_line(B,C,triangle[0]);
// api_curve_line(C,D,triangle[1]);
// api_curve_line(D,B,triangle[2]);
// /*api_curve_line(A,B,triangle[3]);
// api_curve_line(A,C,triangle[4]);
// api_curve_line(A,D,triangle[5]);*/
//
//
// /* api_curve_arc_3pt(B1,C1,D1,true,curve);
// api_make_ewire(1,&curve,point_body);*/
//
// api_make_ewire(3,triangle,line_body);
// /*api_make_ewire(1,triangle+3,line_body1);
// api_make_ewire(1,triangle+4,line_body2);
// api_make_ewire(1,triangle+5,line_body3);*/
// //api_make_ewire(3,triangle,line_body);
// BODY* bodies[2] = {line_body,point_body};
// BODY* result;
// api_skin_wires(2,bodies,result,0,1,1,1,1,1,0);
// pModelEntityList.add(result);
// //pModelEntityList.add(line_body);
// /*pModelEntityList.add(line_body1);
// pModelEntityList.add(line_body2);
// pModelEntityList.add(line_body3);*/
// //pModelEntityList.add(point_body);
// break;
// }
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\Mesh.sat",pModelEntityList);
//}
//void test_skin(){
// EDGE* circle_edge;
// EDGE* circle_edge1;
// BODY* circle_body;
// BODY* circle_body1;
// SPAposition ptcenter(0,0,0),ptcenter1(0,5,10);
//
// api_curve_arc(ptcenter,3,0,2*3.141592654,circle_edge);
// api_make_ewire(1,&circle_edge,circle_body);
//
// api_curve_arc(ptcenter1,1,0,2*3.141592654,circle_edge1);
// api_make_ewire(1,&circle_edge1,circle_body1);
//
// BODY* defaul[2]={ circle_body, circle_body1};
// BODY* jonabody;
// api_skin_wires(2,defaul,jonabody);
// ENTITY_LIST pModelEntityList;
// pModelEntityList.init();
// pModelEntityList.add(jonabody);
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\testSkin.sat",pModelEntityList);
//}
//void test_cone(){
// EDGE* circle_edge,*circle_edge1,*circle_edge2,*circle_edge3,*circle_edge4,*circle_edge5;
// BODY* circle_body,* circle_body1,* circle_body2,* circle_body3,* circle_body4,*circle_body5,*point_body;
// SPAposition A(0,0,12),B(0,0,10),C(0,0,8),D(0,0,6),E(0,0,4),F(0,0,2),G(0,0,0);
//
// SPAposition pts[1] = {A};
// api_build_wire (NULL, FALSE, 1, pts,NULL, point_body);
//
// api_curve_arc(B,5.0/6.0,0,2*3.141592654,circle_edge);
// api_make_ewire(1,&circle_edge,circle_body);
//
// api_curve_arc(C,5.0/3.0,0,2*3.141592654,circle_edge1);
// api_make_ewire(1,&circle_edge1,circle_body1);
//
// api_curve_arc(D,5.0/2.0,0,2*3.141592654,circle_edge2);
// api_make_ewire(1,&circle_edge2,circle_body2);
//
// api_curve_arc(E,10.0/3.0,0,2*3.141592654,circle_edge3);
// api_make_ewire(1,&circle_edge3,circle_body3);
//
// api_curve_arc(F,25.0/6.0,0,2*3.141592654,circle_edge4);
// api_make_ewire(1,&circle_edge4,circle_body4);
//
// api_curve_arc(G,5.0,0,2*3.141592654,circle_edge5);
// api_make_ewire(1,&circle_edge5,circle_body5);
//
// BODY* bodies[7] = {point_body,circle_body,circle_body1,circle_body2,circle_body3,circle_body4,circle_body5};
// BODY* result;
// api_skin_wires(7,bodies,result);
// //BODY* cone;
// //api_solid_cylinder_cone(SPAposition (0,0,13),SPAposition (0,0,25),5,5,0,NULL,cone);
// ENTITY_LIST pModelEntityList;
// pModelEntityList.init();
// pModelEntityList.add(result);
// //pModelEntityList.add(cone);
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\testCone.sat",pModelEntityList);
//}
//void test_sphere(){
// EDGE* circle_edge,*circle_edge1,*circle_edge2,*circle_edge3,*circle_edge4;
// BODY* circle_body,* circle_body1,* circle_body2,* circle_body3,* circle_body4;
// //APOINT* A = new APOINT(0,0,5);
// //APOINT* B = new APOINT(0,0,-5);
// //APOINT* a,*b;
// SPAposition A(0,0,5),B(0,0,-5);
// //EDGE* point,*point1;
// BODY* point_body,*point_body1;
// SPAposition pts[1] = {A};
// SPAposition pts1[1] = {B};
// //VERTEX* AA = new VERTEX(A);
// //VERTEX* BB = new VERTEX(B);
// //api_solid_block(SPAposition(0,0,5), SPAposition(0,0,5),point_body);
// //api_solid_block(SPAposition(0,0,-5), SPAposition(0,0,-5),point_body1);
// api_build_wire (NULL, FALSE, 1, pts,NULL, point_body, NULL);
// api_build_wire (NULL, FALSE, 1, pts1,NULL, point_body1, NULL);//构建点实体的方法
// //api_create_point(A,a,NULL);
//
// //api_curve_line(A, A, point, NULL ) ;
//
// //api_curve_arc(A,SPAresabs,0,2*3.141592654,point);
// //api_make_ewire(1,&point,point_body);
//
// //api_curve_arc(B,SPAresabs,0,2*3.141592654,point1);
// //api_curve_line(B,B, point, NULL ) ;
// //api_make_ewire(1,&point1,point_body1);
//
// SPAposition C(0,0,3),D(0,0,4),E(0,0,-3),F(0,0,-4),G(0,0,0);
//
// api_curve_arc(C,4,0,2*3.141592654,circle_edge);
// api_make_ewire(1,&circle_edge,circle_body);
//
// api_curve_arc(D,3,0,2*3.141592654,circle_edge1);
// api_make_ewire(1,&circle_edge1,circle_body1);
//
// api_curve_arc(E,4,0,2*3.141592654,circle_edge2);
// api_make_ewire(1,&circle_edge2,circle_body2);
//
// api_curve_arc(F,3,0,2*3.141592654,circle_edge3);
// api_make_ewire(1,&circle_edge3,circle_body3);
//
// api_curve_arc(G,5,0,2*3.141592654,circle_edge4);
// api_make_ewire(1,&circle_edge4,circle_body4);
//
// BODY* bodies[7] = {point_body,circle_body1,circle_body,circle_body4,circle_body2,circle_body3,point_body1};
// BODY* result;
// api_skin_wires(7,bodies,result);
//
// ENTITY_LIST pModelEntityList;
// pModelEntityList.init();
// pModelEntityList.add(result);
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\testSphere.sat",pModelEntityList);
//}
//void test_sphere1(){
// EDGE* circle_edge,*circle_edge1,*circle_edge2,*circle_edge3,*circle_edge4;
// BODY* circle_body,* circle_body1,* circle_body2,* circle_body3,* circle_body4;
// //APOINT* A = new APOINT(0,0,5);
// //APOINT* B = new APOINT(0,0,-5);
// //APOINT* a,*b;
// SPAposition A(0,0,5),B(0,0,-5);
// //EDGE* point,*point1;
// BODY* point_body,*point_body1;
// SPAposition pts[1] = {A};
// SPAposition pts1[1] = {B};
// //VERTEX* AA = new VERTEX(A);
// //VERTEX* BB = new VERTEX(B);
// //api_solid_block(SPAposition(0,0,5), SPAposition(0,0,5),point_body);
// //api_solid_block(SPAposition(0,0,-5), SPAposition(0,0,-5),point_body1);
// api_build_wire (NULL, FALSE, 1, pts,NULL, point_body, NULL);
// api_build_wire (NULL, FALSE, 1, pts1,NULL, point_body1, NULL);//构建点实体的方法
// //api_create_point(A,a,NULL);
//
// //api_curve_line(A, A, point, NULL ) ;
//
// //api_curve_arc(A,SPAresabs,0,2*3.141592654,point);
// //api_make_ewire(1,&point,point_body);
//
// //api_curve_arc(B,SPAresabs,0,2*3.141592654,point1);
// //api_curve_line(B,B, point, NULL ) ;
// //api_make_ewire(1,&point1,point_body1);
//
// SPAposition C(0,0,3),D(0,0,4),E(0,0,-3),F(0,0,-4),G(0,0,0);
//
// api_curve_arc(C,4,0,2*3.141592654,circle_edge);
// api_make_ewire(1,&circle_edge,circle_body);
//
// api_curve_arc(D,3,0,2*3.141592654,circle_edge1);
// api_make_ewire(1,&circle_edge1,circle_body1);
//
// api_curve_arc(E,4,0,2*3.141592654,circle_edge2);
// api_make_ewire(1,&circle_edge2,circle_body2);
//
// api_curve_arc(F,3,0,2*3.141592654,circle_edge3);
// api_make_ewire(1,&circle_edge3,circle_body3);
//
// api_curve_arc(G,5,0,2*3.141592654,circle_edge4);
// api_make_ewire(1,&circle_edge4,circle_body4);
//
//BODY* bodies[7] = {point_body,circle_body1,circle_body,circle_body4,circle_body2,circle_body3,point_body1};
// //BODY* result;
// //api_skin_wires(7,bodies,result);
//
// ENTITY_LIST pModelEntityList;
// pModelEntityList.init();
// for(int i=0;i<7;++i)
// pModelEntityList.add(bodies[i]);
// SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\testSphere1.sat",pModelEntityList);
//}
//void test_cover(){
// /*ENTITY_LIST* list1 = new ENTITY_LIST;
// ENTITY_LIST *list2 = new ENTITY_LIST;
// ENTITY_LIST pModelEntityList;
// pModelEntityList.init();
// list1->add(circle_edge);
// list2->add(circle_edge1);
// ENTITY_LIST * array_circuits[2] = {list1,list2};
// api_cover_circuits(2,array_circuits,*(surface *)NULL,pModelEntityList,NULL);*/
//
//
// /* pModelEntityList.add(circle_body);
// pModelEntityList.add(circle_body1);*/
// //SaveSatFile("C:\\Users\\Jonathan_Lewis\\Desktop\\testCover.sat",pModelEntityList);
//}