C#ATIA

↑タイトル詐欺 主にFusion360API 偶にCATIA V5 VBA(絶賛ネタ切れ中)

addByThreePointsメソッドのバグ

こちらの実験中です。
[bug] addByThreePoints method fails to create arc if the 3 points are too close - Autodesk Community

まだ結果をまとめていませんが、ちょっと予想と違いました。

# Fusion360API Python script

import traceback
import adsk
import adsk.core as core
import adsk.fusion as fusion

TOLERANCE = 0.000000001

def run(context):
    ui: core.UserInterface = None
    try:
        app: core.Application = core.Application.get()
        ui = app.userInterface
        des: fusion.Design = app.activeProduct
        root: fusion.Component = des.rootComponent

        x = 0.0009

        posAry = [
            (0, 0, 0),
            (x * 0.5, 0.01, 0),
            (x, 0, 0),
        ]

        skt: fusion.Sketch = root.sketches.add(root.xYConstructionPlane)
        pnts = [core.Point3D.create(x,y,z) for x,y,z in posAry]

        arcs: fusion.SketchArcs = skt.sketchCurves.sketchArcs
        arc: fusion.SketchArc = None
        SuccessValue = pnts[1].y + TOLERANCE * 2

        count = 0

        skt.isComputeDeferred = True
        while (SuccessValue - pnts[1].y) > TOLERANCE:
            count += 1
            try:
                arc = arcs.addByThreePoints(
                    pnts[0],
                    pnts[1],
                    pnts[2],
                )
                arc.deleteMe()
                SuccessValue = pnts[1].y
                pnts[1].y *= 0.5
            except:
                pnts[1].y += (SuccessValue - pnts[1].y) * 0.5

        skt.isComputeDeferred = False

        print(f'{pnts[1].y:f}:{count}')

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))

単にCADのトレランスの限界のような気がする。