Sketch Offset API not honor distance parameter

Sketch Offset API not honor distance parameter

matt.zhang105
Explorer Explorer
818 Views
3 Replies
Message 1 of 4

Sketch Offset API not honor distance parameter

matt.zhang105
Explorer
Explorer

Hi,

 

I am using Sketch Offset API to do a 6 mm offset for a selected profile. However, when I measure it later, it shows the distance between the two loops are not 6 mm.  If I use the UI to offset the same 6mm, it shows exact 6mm when I measure it. In my screen shot, there are 3 loops. The inner one is my sketch. The middle one is generated using my python code. The outer one is using UI. Am I missing something here? Thank you in advance.

 

Here is my code:

        currentProfile = adsk.fusion.Profile.cast(clonedSketch.profiles[0])
        centerX = (currentProfile.boundingBox.maxPoint.x + currentProfile.boundingBox.minPoint.x) / 2
        centerY = (currentProfile.boundingBox.maxPoint.y + currentProfile.boundingBox.minPoint.y) / 2
        center = adsk.core.Point3D.create(centerXcenterY0)
        handle_curves = clonedSketch.offset(curvescenter, -0.6)
0 Likes
Accepted solutions (1)
819 Views
3 Replies
Replies (3)
Message 2 of 4

JesusFreke
Advocate
Advocate
Accepted solution

I recently reported this as well.

 

I didn't get any responses from the F360 devs, but I do at least have a workaround for you. Instead of using a negative offset, you can switch the point to the other side of the curve and use a positive offset, and the distance should be correct - at least as far as I've seen.

Message 3 of 4

matt.zhang105
Explorer
Explorer

@JesusFreke Thank you very much. Your workaround worked very well.

 

Here is updated code that works:

        curves = clonedSketch.findConnectedCurves(clonedSketch.sketchCurves[0])
        currentProfile = adsk.fusion.Profile.cast(clonedSketch.profiles[0])
        centerX = currentProfile.boundingBox.maxPoint.x + 1
        centerY = currentProfile.boundingBox.maxPoint.y + 1
        center = adsk.core.Point3D.create(centerXcenterY0)
        handle_curves = clonedSketch.offset(curvescenter0.6)
Message 4 of 4

panwarparam11
Explorer
Explorer

thanks

 

0 Likes