gear design

gear design

martyn158EYZJ7
Contributor Contributor
1,779 Views
12 Replies
Message 1 of 13

gear design

martyn158EYZJ7
Contributor
Contributor

hello people of greater understanding, i'm trying to learn about gears with the spur gear add-on/in and while ive managed to make some larger gears (i really have no idea how) trying to make samller ones seems problematic throwing this error regardless of the parameters i put in

Screenshot 2023-01-12 at 19.11.04.png

 i realise that the following parameters ive entered (screenshot below) are wrong but i dont know why

Screenshot 2023-01-12 at 19.08.48.png

 it'll produce the round part but dosen't want to make any teeth, i have been looking at youtube videos but they all seem to know the measurements and/or other 'things' they need before they start

things.png

thanks in advance 

martyn the wanna be maker  

0 Likes
Accepted solutions (1)
1,780 Views
12 Replies
Replies (12)
Message 2 of 13

0xHexdec
Contributor
Contributor

I really don't know what exectly happens there, looked into it with the debugger for a view minutes.

The error gets thrown in line 673:

toothSketch.sketchCurves.sketchArcs.addByThreePoints(spline1.endSketchPoint, midPoint, spline2.endSketchPoint)

but as far as I can see, there is neither something wrong with this line nor its runtime values. Maybe someone wants to look into it.

Message 3 of 13

kandennti
Mentor
Mentor

Hi @martyn158EYZJ7 .

 

I have not tried it, but I think there are some add-ins for creating gears in the Autodesk App Store.

https://apps.autodesk.com/FUSION/en/Home/Index 


Why don't you try something else?

0 Likes
Message 4 of 13

kandennti
Mentor
Mentor

 

@martyn158EYZJ7 .

 

@jsugano_igears on the Japanese forum has investigated this error in detail.

All in Japanese, but with additional source code to deal with the attached PDF file.

https://forums.autodesk.com/t5/fusion-360-ri-ben-yu/go-can-kao-spurgear-shi-baino-tui-ding-yuan-yint... 

Message 5 of 13

martyn158EYZJ7
Contributor
Contributor

hi @kandennti i did try the app's in the store, all except the paid ones and for good reason, all the ones that i have tried (with the one exception being for helical gears that i don't need) have crashed fusion resulting in me sending a few error reports, i thought it was me or my machine so in a way i'm relieved it isn't.

i had a look at the thread you linked but i dont know how to follow a thread so i'll keep it open for now to see where it goes

thanks for pointing me in the right direction

0 Likes
Message 6 of 13

BrianEkins
Mentor
Mentor

I looked at this, and it appears to be a bug with the SketchArcs.addByThreePoints method. The points computed by the program are correct, but the creation of the arc is failing. If I create the desired arc interactively, it succeeds, so the problem is limited to the API. I'll see that a bug gets filed. Once the arc bug is fixed, the sample should work without changes.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 7 of 13

martyn158EYZJ7
Contributor
Contributor

so....... decided to just go with the module of 0.75 as a compromise and all was good, that is until i decided a gear with 80 teeth would be needed next which looks like this

Screenshot 2023-01-13 at 21.01.15.png

which gave me a similar but not the same error as shown here

Screenshot 2023-01-13 at 21.02.43.png

 it seems to me that there is a very limited range in which the add-on will work, i think im going to have to import drawings from now on (sad face)

thought i should add this just in case it makes a difference in the way things work as i have no idea how add-on's are made or operate (yet) 

0 Likes
Message 8 of 13

jsugano_igears
Advocate
Advocate
Accepted solution

Hi @martyn158EYZJ7 .
I have confirmed that this problem occurs when the 3 points that make up the tip arc are close to flat. The smaller the arc width, the wider the area of ​​arc height error. That's why it's more likely to occur in small modules.
If you have the skill to rewrite the 'SpurGear.py' script, how about doing the following as a temporary measure? This will create a spline instead if an error occurs while creating the arc.

around line 660

        # Draw the arc for the top of the tooth.
        midPoint = adsk.core.Point3D.create((outsideDia / 2), 0, 0)
        #toothSketch.sketchCurves.sketchArcs.addByThreePoints(spline1.endSketchPoint, midPoint, spline2.endSketchPoint)    
 
        try:
            toothSketch.sketchCurves.sketchArcs.addByThreePoints(
                spline1.endSketchPoint, midPoint, spline2.endSketchPoint)    
        except Exception as error:
            tipArcPnts = adsk.core.ObjectCollection.create()
            tipArcPnts.add(spline1.endSketchPoint)
            tipArcPnts.add(midPoint)
            tipArcPnts.add(spline2.endSketchPoint)

            toothSketch.sketchCurves.sketchFittedSplines.add(tipArcPnts)

 

Japanese documents are attached. On page 3 there is a threshold graph for success or failure in the original program.

This method works in my environment, but there is no warranty. I hope someone will try this method or improve it.

Message 9 of 13

martyn158EYZJ7
Contributor
Contributor

hi @jsugano_igears 

i added the aditions you recommended and did sort of get it to work, i had to close the profile myself but im ok with that, it also still chucks an error at me but at least im able to get something so thank you.

here's how my edit looks...

Screenshot 2023-01-14 at 12.07.50.png

ive only really put that there in case others need to see where exactly it is and if ive done it correctly

 and this is the result

Screenshot 2023-01-14 at 12.15.33.png

 again, had to modify the tooth via edit scetch but this will work fine for now.

also, im not sure if i should mark this as solved or not as the add-on itself is not fixed for other people who may not know how to edit the script

0 Likes
Message 10 of 13

jsugano_igears
Advocate
Advocate
Hi @martyn158EYZJ7 .

Thank you for doing this. It's a little different than the fix I requested.
Try deleting line 669 or commenting it out.
Message 11 of 13

martyn158EYZJ7
Contributor
Contributor

you sir @jsugano_igears are a star, its working flawlessly now, i realized after reading the preceeding lines where i went wrong so a big thank you to you, here is the code edited as it is on my system now (i've left it commented for now as per your suggestion)

Screenshot 2023-01-14 at 14.11.08.png

thanks again

Message 12 of 13

jsugano_igears
Advocate
Advocate
I am very happy to hear the result. Thank you.
Message 13 of 13

2721297306
Community Visitor
Community Visitor
Thank you.
it worked perfectly.
0 Likes