如何使用Eyeshot的功能创建螺丝形状

问题描述

我需要使用.NET应用程序中的Eyeshot库创建螺丝形状。

在SolidWorks中,只需创建需要进行扫掠/拉伸的形状/轮廓以及用作轨道或方向的螺旋曲线即可轻松实现。

在SolidWorks中,将螺旋起点定位到​​轮廓直径的某个点,并使用“扫掠”命令结果将要围绕该螺旋驱动/旋转的点并创建所需的形状。

SolidWorks example

在Eyeshot中,我将个人资料创建为LinearPath实体并使用

SweepAsSolid(ICurve rail,double tol,sweepMethodType sweepMethod = sweepMethodType.RotationMinimizingFrames)

功能,但结果不同。似乎SweepAsSolid函数位置螺旋起始点位于轮廓中心且形状不同。

是否可以使用与SolidWorks中相同的步骤通过Eyeshot的库获取所需形状?

解决方法

我认为您正在寻找方法ExtrudeWithTwist():

 func detectScreenShot(action: @escaping () -> ()) {
       UIScreen.main.addObserver(self,forKeyPath: "captured",options: .new,context: nil)
        
        let mainQueue = OperationQueue.main
        NotificationCenter.default.addObserver(forName: UIApplication.userDidTakeScreenshotNotification,object: nil,queue: mainQueue) { notification in
            // executes after screenshot
            print(notification)
            action()
        }
    }



override func observeValue(forKeyPath keyPath: String?,of object: Any?,change: [NSKeyValueChangeKey: Any]?,context: UnsafeMutableRawPointer?) {
        if (keyPath == "captured") {
            let isCaptured = UIScreen.main.isCaptured
          
            print(isCaptured)
        }
    }

the result