当前位置: 首页 > news >正文

做网站引流的最佳方法品牌全案营销策划

做网站引流的最佳方法,品牌全案营销策划,贸易公司寮步网站建设价钱,大连哪个公司做网站开发的前言:在很多情况下,需要根据点云来拟合球体,本博文主要介绍各种方法的拟合情况及优缺点,希望对各位小伙伴有所帮助! 目录 1. vtkFitImplicitFunction进行球拟合 2. 四点求解球 1. vtkFitImplicitFunction进行球拟合 …

前言:在很多情况下,需要根据点云来拟合球体,本博文主要介绍各种方法的拟合情况及优缺点,希望对各位小伙伴有所帮助!

目录

1. vtkFitImplicitFunction进行球拟合

2. 四点求解球


1. vtkFitImplicitFunction进行球拟合

缺点:需要输入待拟合球的半径和结构,即在已知最优解的情况下求解。

vtkMath::RandomSeed(4355412); // for test result consistencydouble radius = 1.0;
vtkSmartPointer<vtkBoundedPointSource> points =vtkSmartPointer<vtkBoundedPointSource>::New();
points->SetNumberOfPoints(1000000);
points->SetBounds(-2.0, 2.0, -2.0, 2.0, -2.0, 2.0);
points->Update();vtkSmartPointer<vtkSphere> sphere =vtkSmartPointer<vtkSphere>::New();
sphere->SetRadius(radius*2);vtkSmartPointer<vtkFitImplicitFunction> fit =vtkSmartPointer<vtkFitImplicitFunction>::New();
fit->SetInputConnection(points->GetOutputPort());
fit->SetImplicitFunction(sphere);
fit->SetThreshold(.01);
fit->Update();
std::cout << fit->GetOutput()->GetNumberOfPoints() << " out of "<< points->GetNumberOfPoints() << " points are within "<< fit->GetThreshold() << " of the implicit function" << std::endl;vtkSmartPointer<vtkSphereSource> sphereSource =vtkSmartPointer<vtkSphereSource>::New();
sphereSource->SetRadius(radius * .05);vtkSmartPointer<vtkGlyph3D> glyph3D =vtkSmartPointer<vtkGlyph3D>::New();
glyph3D->SetInputConnection(fit->GetOutputPort());
glyph3D->SetSourceConnection(sphereSource->GetOutputPort());
glyph3D->ScalingOff();
glyph3D->Update();vtkSmartPointer<vtkPolyDataMapper> glyph3DMapper =vtkSmartPointer<vtkPolyDataMapper>::New();
glyph3DMapper->SetInputConnection(glyph3D->GetOutputPort());vtkSmartPointer<vtkActor> glyph3DActor =vtkSmartPointer<vtkActor>::New();
glyph3DActor->SetMapper(glyph3DMapper);
glyph3DActor->GetProperty()->SetColor(0.8900, 0.8100, 0.3400);m_viewer->renderWindow()->GetRenderers()->GetFirstRenderer()->AddActor(glyph3DActor);
m_viewer->renderWindow()->Render();

2. 四点求解球

缺点:要求输入的四点为精确球上的点;否则计算错误。

void fitSphere(vtkPoints* points, double center[3], double& radius) {double p1[3];double p2[3];double p3[3];double p4[3];points->GetPoint(0, p1);points->GetPoint(1, p2);points->GetPoint(2, p3);points->GetPoint(3, p4);double a = p1[0] - p2[0], b = p1[1] - p2[1], c = p1[2] - p2[2];double a1 = p3[0] - p4[0], b1 = p3[1] - p4[1], c1 = p3[2] - p3[2];double a2 = p2[0] - p3[0], b2 = p2[1] - p3[1], c2 = p2[2] - p3[2];double D = a * b1 * c2 + a2 * b * c1 + c * a1 * b2 - (a2 * b1 * c + a1 * b * c2 + a * b2 * c1);if (D == 0){return;}double A = p1[0] * p1[0] - p2[0] * p2[0];double B = p1[1] * p1[1] - p2[1] * p2[1];double C = p1[2] * p1[2] - p2[2] * p2[2];double A1 = p3[0] * p3[0] - p4[0] * p4[0];double B1 = p3[1] * p3[1] - p4[1] * p4[1];double C1 = p3[2] * p3[2] - p4[2] * p4[2];double A2 = p2[0] * p2[0] - p3[0] * p3[0];double B2 = p2[1] * p2[1] - p3[1] * p3[1];double C2 = p2[2] * p2[2] - p3[2] * p3[2];double P = (A + B + C) / 2;double Q = (A1 + B1 + C1) / 2;double R = (A2 + B2 + C2) / 2;double Dx = P * b1 * c2 + b * c1 * R + c * Q * b2 - (c * b1 * R + P * c1 * b2 + Q * b * c2);double Dy = a * Q * c2 + P * c1 * a2 + c * a1 * R - (c * Q * a2 + a * c1 * R + c2 * P * a1);double Dz = a * b1 * R + b * Q * a2 + P * a1 * b2 - (a2 * b1 * P + a * Q * b2 + R * b * a1);center[0] = Dx / D;center[1] = Dy / D;center[2] = Dz / D;radius = sqrt((p1[0] - center[0]) * (p1[0] - center[0]) +(p1[1] - center[1]) * (p1[1] - center[1]) +(p1[2] - center[2]) * (p1[2] - center[2]));}

http://www.tj-hxxt.cn/news/20372.html

相关文章:

  • 做网站卖资料谁能给我个网址
  • 长春网站网站建设seo新手快速入门
  • 千库网免费背景素材关键词优化排名的步骤
  • 机械毕业论文代做网站企业网站推广有哪些方式
  • 闽侯县住房和城乡建设网站比较好的网络优化公司
  • 做1元夺宝网站挣钱吗百度小说排行榜前十
  • 西安做网站报价深圳百度关键词排名
  • 做网站外包大学生怎么在百度上添加自己的店铺地址
  • 做网站用虚拟主机好吗请简述网络营销的特点
  • 公司做网站推广东莞百度seo哪里强
  • 政府网站建设情况谷歌浏览器免费入口
  • 做网站设计制作的公司网站制作软件
  • 旅游网站建设主要工作网络营销案例分析论文
  • 东莞附近公司做网站建设多少钱linux网站入口
  • 百度网址大全官方网站浙江网站建设制作
  • 郑州网站建设扌汉狮网络百度关键词热度
  • 给帅哥做奴视频网站地址魔贝课凡seo
  • 网站建设流程总结品牌广告策划方案
  • cbd网站建设站长工具源码
  • 网站建设长沙seo助手
  • 松岗网站建设百度竞价返点开户
  • 上海市网站建网站seo优化皆宣徐州百都网络不错
  • 网站建设中可能出现的问题50篇经典软文100字
  • 好兄弟资源网在线看片sem优化
  • 生活中常见的网络营销形式长沙谷歌优化
  • 手机管理网站模板下载刷关键词优化排名
  • java入门网站合肥网站推广优化
  • 网站建设陷阱百度seo关键词排名技术
  • 北京做网站哪个好软文广告代理平台
  • 苏州网站建设设计制作公司网站建设排名优化