Get清风CADCAM实验报告.docx

上传人:b****5 文档编号:11936132 上传时间:2023-04-16 格式:DOCX 页数:13 大小:328.16KB
下载 相关 举报
Get清风CADCAM实验报告.docx_第1页
第1页 / 共13页
Get清风CADCAM实验报告.docx_第2页
第2页 / 共13页
Get清风CADCAM实验报告.docx_第3页
第3页 / 共13页
Get清风CADCAM实验报告.docx_第4页
第4页 / 共13页
Get清风CADCAM实验报告.docx_第5页
第5页 / 共13页
点击查看更多>>
下载资源
资源描述

Get清风CADCAM实验报告.docx

《Get清风CADCAM实验报告.docx》由会员分享,可在线阅读,更多相关《Get清风CADCAM实验报告.docx(13页珍藏版)》请在冰豆网上搜索。

Get清风CADCAM实验报告.docx

Get清风CADCAM实验报告

CADCAM实验报告

二叉树的遍历实验

一、实验名称:

二叉树的遍历实验。

二、实验目的:

1、掌握CAD/CAM系统中常用的数据结构二叉树的概念、存储结构以及二叉树遍历技术。

2、熟练应用C语言编写二叉树的建立,以及用先序、中序、后序遍历方法遍历二叉树的程序。

三、实验内容

用TC或VC编程,将图2-14所示的二叉树建立链表存储结构,并分别用先序、中序、后序遍历方法遍历该二叉树α

1、程序流程图

2、程序

#include

#include

structbtree

{chardata;

structbtree*lchild,*rchild;

}*node[9];

voidpreorder(structbtree*node)

{if(!

node)return;

printf("%c",node->data);

preorder(node->lchild);

preorder(node->rchild);

}

voidinorder(structbtree*node)

{if(!

node)return;

inorder(node->lchild);

printf("%c",node->data);

inorder(node->rchild);

}

voidpostorder(structbtree*node)

{if(!

node)return;

postorder(node->lchild);

postorder(node->rchild);

printf("%c",node->data);

}

voidmain()

{

inti;

for(i=0;i<9;i++)

{

node[i]=(structbtree*)malloc(sizeof(structbtree));

node[i]->data='A'+i;

node[i]->lchild=NULL;

node[i]->rchild=NULL;

}

node[0]->lchild=node[1];

node[0]->rchild=node[2];

node[1]->lchild=node[3];

node[2]->lchild=node[4];

node[2]->rchild=node[5];

node[3]->lchild=node[6];

node[3]->rchild=node[7];

node[4]->rchild=node[8];

printf("按先序遍历:

");

preorder(node[0]);

printf("\n按中序遍历:

");

inorder(node[0]);

printf("\n按后序遍历:

");

postorder(node[0]);

getchar();

return0;

}

实验结果如下:

三、主要仪器设备

计算机〔C++语言环境〕

 

实验二数表的程序化处理

一、实验名称:

数表的程序化处理

二、实验目的

1、掌握对工程手册和设计标准中的各种数据表格〔包括数值、数表、线图〕的计算机处理技术。

2、熟练应用C语言或VC金星编程数据处理程序。

三、实验内容

用TC或VC编写一个线性插值程序,以下表为根本节点参数,插值计算90°-160°范围内任意角度的包角修正系数Kα。

α/〔°〕

90100110120130140150160

1、程序流程图

2、程序

#include

#include

#include

voidmain()

{

inti,j;

inta[8]={90,100,110,120,130,140,150,160};

doublek[8]={0.68,0.74,0.79,0.83,0.86,0.89,0.92,0.95};

doublem;

for(;;)

{

do

{printf("请输入包角值:

〔包角范围为90°至160°〕\n");

scanf("%d",&j);

if(j<90||j>160)

{

printf("包角输入错误,请重新输入。

\n");

printf("按回车键继续查询,按Ctrl+C键退出\n");

getchar();

getchar();

system("cls");

}

}while(j<90||j>160);

for(i=0;i<8;i++)

{

if(j==a[i])

m=k[i];

if(j>a[i]&&j

}

printf("包角为%d°的包角修正系数为%.3lf\n",j,m);

printf("请按任意键继续查询,按Ctrl+C键退出\n");

getchar();

getchar();

system("cls");

}

}

 

实验三机械零件三维造型

一、实验目的

四、了解三维造型技术的根本原理;

五、熟悉三维造型软件的根本使用方法;

六、掌握用三维造型软件构造三维实体零件的步骤。

二、实验内容

用ProE构造支架零件

三、实验报告

1、三维零件模型

 

 

2、零件构成过程是CSG树

 

实验四排料图编程绘制

3、实验目的

七、熟悉AutoCAD中的二次开发工具AutoLISP的各项功能函数;

八、了解AutoLISP的编程过程和方法;

九、掌握在AutoCAD下实现排料图的绘制技术。

4、实验内容

板材尺寸为L×B,在该板料上气割假设干个半径为R的圆板,如果不计割缝,按实验图中排版方式,问用这块板最多可以割下多少块圆板?

编程绘制出排料图。

说明:

1.L=2000,B=1000,R=(班号*10).学号,如2班3号,R=20.03。

2.圆板数用CN变量表示。

3.输出圆板数,并绘制排料图。

 

5、实验报告

1、画出程序流程图

2、编写程序并调试运行出程序结果

〔1〕实验程序

(defunc:

PL()

(setqL(getreal"\n请输入板料长度L:

"))

(setqB(getreal"\n请输入板料厚度B:

"))

(setqR50.17)

(setqCL(fix(/L(*2R))))

(setqCB(fix(/B(*2R))))

(command"zoom""w"'(00)'(LB))

(setqp1(getpoint"\n输入绘图基点p1"))

(setqp2(polarp1(/pi2)B))

(setqp3(polarp20L))

(setqp4(polarp10L))

(command"pline"p1p2p3p4"c")

(setqM0)

(while(

(setqph(polarp1(/pi2)(*R(+(*M2)1))))

(setqpc(polarph0R))

(setqN0)

(while(

(command"circle"pcR)

(setqpc(polarpc0(*2R)))

(setqN(+N1))

(setqM(+M1))

(setqCN(*CLCB))

(prompt(strcat"\n-----圆板数:

"(itoaCN)"-----\n"))

〔2〕运行结果

输入:

L=2000,B=1000

输出NC=171

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 工程科技 > 能源化工

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1