【此系列文章基于熔融沉积( fused depostion modeling, FDM )成形工艺】

这一篇文章我讲一下多边打印的问题,多边打印是切片引擎的一项关键的技术。

图1 双边打印



首先。它能够保证打印实体表面免受内部填充的冲击,保证外观的真实度;其次,在上层在相对于下层倾斜较大时。多边打印能够非常好的起到支撑的作用,避免上层塌陷。

但是,眼下来说,我的多边打印还不够普适,对一些不规范的模型,以及模型中非常尖锐的特征效果并不好,对绝大部分的较为平滑的模型是全然没有问题的。

以下就简单说一下它的原理:如果边界中的随意相邻的向量AB和BC,这里要找的是点d(角ABC中心线上的一点),看下图:



找出边界环中每个相邻向量的d点。工作就基本完毕了。

所以原理非常easy,仅仅只是是非常多琐碎的细节须要处理好,比方说向量Bd的方向问题。B点和d点的欧氏距离等等,不能再说了。再说就有误导人之嫌。事实上这段时间细想。我的切片引擎的这些想法并无优秀可言。但是还是想把那段时间的工作记录下来。仅此而已。闲话说几句。这段时间在做与測绘相关的算法,本来觉得能够写成博文与大家分享的东西,结果硬是变成了核心期刊上的论文了,哎,仅仅是觉得那个东西离论文水平的创新还有不小的距离啊,看来,国内的论文质量……。呵呵。以下呈上代码,当中getInnerBoundary函数有些不够规范。用了goto跳转,并且一些细节也不是最科学,当初主要是赶进度,为了适应公司的建模能力不足。

void getAngularBisector(float3 &bisector,float3 point,float3 leftPoint,float3 rightPoint)
{
float3 v1,v2; float norm1,norm2,angle; get_vector_diff(v1,leftPoint,point); get_vector_diff(v2,rightPoint,point); if(v1[0]*v2[1]==v1[1]*v2[0])
{
if(v1[1]==v2[1])
{
bisector[0]=0; bisector[1]=1; bisector[2]=0;
}
else if(v1[0]==v2[0])
{
bisector[0]=1; bisector[1]=0; bisector[2]=0;
}
else
{
bisector[0]=point[0]-1; bisector[1]=((v1[0]-v2[0])+(v1[1]-v2[1])*point[1])/(v1[1]-v2[1]); bisector[2]=0;
} }
else
{
getNormalizeVector(v1); getNormalizeVector(v2); if(v1[0]*v2[1]==v1[1]*v2[0])
{
if(v1[1]==v2[1])
{
bisector[0]=0; bisector[1]=1; bisector[2]=0;
}
else if(v1[0]==v2[0])
{
bisector[0]=1; bisector[1]=0; bisector[2]=0;
}
else
{
bisector[0]=point[0]-1; bisector[1]=((v1[0]-v2[0])+(v1[1]-v2[1])*point[1])/(v1[1]-v2[1]); bisector[2]=0;
} }
else
{
get_vector_sum(bisector,v1,v2);
}
}
} void getInnerPoint(float3 &innerPoint,float3 point,float3 leftPoint,float3 rightPoint,float margin)
{
float3 bisector; float distance,rate; distance=margin; getAngularBisector(bisector,point,leftPoint,rightPoint); rate=distance/sqrt(pow(bisector[0],2)+pow(bisector[1],2)+pow(bisector[2],2)); innerPoint[0]=point[0]+bisector[0]*rate; innerPoint[1]=point[1]+bisector[1]*rate; innerPoint[2]=point[2]+bisector[2]*rate; if(get_vector3_det(point,rightPoint,innerPoint)<0)
{ innerPoint[0]=point[0]-bisector[0]*rate; innerPoint[1]=point[1]-bisector[1]*rate; innerPoint[2]=point[2]-bisector[2]*rate;
}
} void getInnerPoint(Phasor *innerPhasor,Phasor *phasor,Phasor*leftPhasor,Phasor *rightPhasor,float margin,int fillMaterial)
{
getInnerPoint(innerPhasor->beginPoint,phasor->beginPoint,leftPhasor->beginPoint,phasor->endPoint,margin); getInnerPoint(innerPhasor->endPoint,phasor->endPoint,phasor->beginPoint,rightPhasor->endPoint,margin); innerPhasor->material=fillMaterial;
} void getInnerBoundary(Phasor *&innerPhasors,Phasor *phasors,int phasor_num,vector<vector<int> > &closedSet
,float lineHeight,int fillMaterial,bool *innerBoundaryStatus)
{
innerPhasors=new Phasor[phasor_num]; int index,indexMain,phasorIndex,phasorIndexLeft,phasorIndexRight; float margin=lineHeight; againScan: if(margin<0.1)
{
*innerBoundaryStatus=false; innerPhasors=NULL; return;
} for(indexMain=0;indexMain!=closedSet.size();++indexMain)
{
int count=0; for(index=0;index!=closedSet[indexMain].size();++index)
{ phasorIndex=closedSet[indexMain][index]; if(index>0)
{
phasorIndexLeft=closedSet[indexMain][index-1];
}
else
{
phasorIndexLeft=closedSet[indexMain][closedSet[indexMain].size()-1];
} phasorIndexRight=closedSet[indexMain][(index+1)%closedSet[indexMain].size()]; getInnerPoint(innerPhasors+phasorIndex
,phasors+phasorIndex
,phasors+phasorIndexLeft
,phasors+phasorIndexRight
,margin,fillMaterial); for(int i=0;i!=phasor_num;++i)
{ if(i==phasorIndex)
{
continue;
} if(get_vector_distance2(innerPhasors[phasorIndex].beginPoint,phasors[phasorIndex].beginPoint)>
get_vector_distance2(innerPhasors[phasorIndex].beginPoint,phasors[i].beginPoint))
{
count++; break;
}
} if(count>closedSet[indexMain].size()/5+1)
{
margin-=0.05; goto againScan;
}
}
}
}

3D打印技术之切片引擎(4)的更多相关文章

  1. 3D打印技术之切片引擎(5)

    [此系列文章基于熔融沉积( fused depostion modeling, FDM )成形工艺] 从这一篇文章開始,就開始说填充.在3D打印切片技术中,填充算法是最核心的部分.3D打印技术的经常使 ...

  2. 3D打印技术之切片引擎(6)

    [此系列文章基于熔融沉积( fused depostion modeling, FDM )成形工艺] 这一篇文章说一下填充算法中的网格填充.网格填充在现有的较为成熟的引擎中是非常普遍的:skeinfo ...

  3. 3D打印技术在医疗上的实际应用与实验室研究

    2018-01-17 Chris 免费3D打印模型资源站 预计阅读时间:5-10分钟 关键字:3D打印髋关节.脊柱置换产品,3D打印技术辅助精准截骨,义齿,生物墨水(BioInk),干细胞   随着& ...

  4. 3D打印技术的火爆,真的会让传统模具行业没落吗?

    当一种新生事物出现时,人们除了赞美它带来的新畅想外,往往还会对"旧事物"贬低几分--各种淘汰观点总是不绝于耳.但可惜的是,新生事物取代旧事物的事儿并不会必然发生.比如,直到现在广播 ...

  5. 3D打印技术的学习

    1. 我们使用3D建模软件:123Ddesign来设计 123D design软件保存格式有2种,分别为123dx和stl格式 123dx格式:选择菜单栏中“Save”下的“To my compute ...

  6. 通过three.js实现简易3D打印模型切片展示

    现在的页面展示要求越来越高,美的展示总能吸引更多的访客.最近在学习3D打印中的切片算法,刚刚入门,发现通过three.js框架可以很好展示出3D切片细节(虽然我做的比较简单). //========= ...

  7. 3D打印:三维智能数字化创造(全彩)

    3D打印:三维智能数字化创造(全彩)(全球第一本系统阐述3D打印与3D智能数字化的专业著作) 吴怀宇 编   ISBN 978-7-121-22063-0 2014年1月出版 定价:99.00元 42 ...

  8. 《3D打印:三维智能数字化创造(全彩)》

    <3D打印:三维智能数字化创造(全彩)> 基本信息 作者: 吴怀宇 出版社:电子工业出版社 ISBN:9787121220630 上架时间:2014-1-13 出版日期:2014 年1月 ...

  9. 进阶篇:3.9)3d打印件设计

    本章目的:了解3d打印,购买3d打印机. 1.3d打印基础知识: 现在主流的3d打印技术有4种:①FDM:②SLA:③SLS:④3DP.具体如下: ①熔融沉积造型(Fused deposition m ...

随机推荐

  1. c3p0-config.xml模板详解

    c3p0-config.xml模板详解 <c3p0-config> <default-config> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数.De ...

  2. Welcome-to-Swift-04集合类型(Collection Types)

    Swift提供了两种集合类型来存放多个值——数组(Array)和字典(Dictionary).数组把相同类型的值存放在一个有序链表里.字典把相同类型的值存放在一个无序集合里,这些值可以通过唯一标识符( ...

  3. HDU——4162Shape Number(字符串的最小表示)

    Shape Number Time Limit: 24000/12000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) T ...

  4. POJ——1321棋盘问题(DFS+回溯)

    棋盘问题 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 33272 Accepted: 16456 Description 在一 ...

  5. 刷题总结——寻宝游戏(bzoj3991 dfs序)

    题目: Description 小B最近正在玩一个寻宝游戏,这个游戏的地图中有N个村庄和N-1条道路,并且任何两个村庄之间有且仅有一条路径可达.游戏开始时,玩家可以任意选择一个村庄,瞬间转移到这个村庄 ...

  6. GC overhead limit exceeded,tomcat修改jvm内存

    tomcat修改jvm内存 内存大小:-Xms256M -Xmx512M -XX:PermSize=256m -XX:MaxNewSize=256m -XX:MaxPermSize=512m -Dja ...

  7. net5:动态修改内存中的站点地图节点

    原文发布时间为:2008-07-29 -- 来源于本人的百度文章 [由搬家工具导入] using System;using System.Data;using System.Configuration ...

  8. 21深入理解C指针之---通过指针传递数据

    一.在C程序设计中,主要活动就是操纵数据 1.数据传递:将数据作为参数传入参数和将数据作为数据返回两种 2.函数: 1).函数类型:主要是指函数返回数据的类型,可以是基本类型或复杂数据类型,即使函数无 ...

  9. js 判断变量是否为空

    js 判断变量是否为空 欢迎指正,补充! /** * 判断变量是否为空, * @param {[type]} param 变量 * @return {Boolean} 为空返回true,否则返回fal ...

  10. Chrome 浏览器如何完美实现滚动截图技巧

    一.前言 我们平时在浏览网页时,想把碰到好的网页内容或者文章截屏保存,但是网页的长度常常会超出屏幕高度,一般的截屏功能只能截取显示在屏幕上的内容,那我们该如何方便快捷截取全部内容?今天就分享一个如何利 ...