【问题标题】:Generating a 3D raster scan over the surface (shell) of non-rectangular shapes在非矩形形状的表面(外壳)上生成 3D 光栅扫描
【发布时间】:2020-07-04 01:53:42
【问题描述】:

所以我有一个业余项目,将 USB 显微镜绑在 3D 打印机上,以拍摄物体在不同 X、Y 和 Z 位置的照片,然后将这些照片拼接成完整的图像。我从这个stack 的代码开始生成一个二维矩形光栅图案,然后通过重复循环以在每次二维扫描后移动 Z 轴来升级它以进行 2.5 维成像(堆叠和拼接),最后做同样的事情带有第 4 个轴以启用 3D 成像。

问题是大多数东西都不是矩形,扫描最终会变得非常浪费,停下来在不是物体或明显失焦的区域拍照。我希望能够 1:移动“扫描平面”,例如扫描向上倾斜的平面物体,以及 2:通常能够生成任意扫描模式,或者至少能够生成简单的理想形状。

您将如何获取有关 3 维形状的信息(例如,来自 STL),并在表面(或至少指向上方的部分)周围包裹一个 2D“点阵”光栅图案?

【问题讨论】:

    标签: python scanning photography cnc


    【解决方案1】:

    我通过原始矩形/长方体扫描了解了执行此操作的基础知识。数学很容易旋转,例如 Y 轴:

    
    def RotateArray(ScanLocations, degrees = 30):
        #function to rotate a 3D array around a specified axis (currently Y). Ideally, around arb point in space.  
        #X Location minus offset becomes new hypotenuse after rotating.
        #(sin(degrees) * X) + Z gives new Z .
        #cos(degrees)* X gives new X. Right? Y should be unchanged.
    
        XLocations,ZLocations = ScanLocations['X'],ScanLocations['Z']
        sinof = sin(np.deg2rad(degrees))
        cosof = cos(np.deg2rad(degrees))
        XOffset = min(XLocations) #not fair to assume it is zeroth position
    
        ZLocations = [round((x-XOffset)*sinof + z,2) for x, z in zip(XLocations, ZLocations)]
        XLocations = [round(((i - XOffset) * cosof)+XOffset,2) for i in XLocations]
    
        ScanLocations['X'] = XLocations
        ScanLocations['Z'] = ZLocations
        return (ScanLocations)
    
    
    

    使用 ncviewer.com 进行可视化:

    original scan

    Rotated Scan around Y axis

    我现在需要解决的一个新问题是重新安排我的动作以提高效率。我想有选择地优先考虑一个轴,例如 Z,以便将堆叠的图像在没有 X/Y 移动的情况下拍摄。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-07
      • 1970-01-01
      相关资源
      最近更新 更多