简体   繁体   English

VTK-椭圆内的2D点云

[英]VTK - 2D Point cloud within an ellipse

Using VTK, I want to create a cloud of points (random amount) located inside an ellipse. 我想使用VTK创建一个位于椭圆内部的点云(随机量)。

So far I've got this: 到目前为止,我已经知道了:

vtkSmartPointer<vtkPointSource> pointSource = vtkSmartPointer<vtkPointSource>::New();
pointSource->SetCenter(0.0, 0.0, 0.0);
pointSource->SetNumberOfPoints(nPoints);
pointSource->SetRadius(radius);
pointSource->Update();

However I wonder how to describe it as an elliptical shaped cloud . 但是我不知道如何将其形容为椭圆形的云

You could use a vtkTransform to convert the point source sphere to an ellipse. 您可以使用vtkTransform将点源球体转换为椭圆形。 Here's an example that scales a plane: http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Modelling/Python/expCos.py 这是一个缩放平面的示例: http : //www.vtk.org/gitweb? p=VTK.git;a=blob; f= Examples/Modelling/Python/ expCos.py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM