Extrude Function Having Strange Behavior
EFish
Member Posts: 16 EDU
Hi, while working on a shaft FeatureScript, some interesting behavior came up when using the extrude function (I do wish I could use the hole function). Where in certain inputs the extrude to apply the values work, but other times it doesn't. Some help would be greatly appreciated.
Document link:
TMM Featurescripts
Document link:
TMM Featurescripts
FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com
Tagged:
0
Best Answer
-
I see you're building a shaft generator for FRC. It might not be a bad idea to take a look at Julia's Shaft FeatureScript, which can be found here.
Since you've been pretty vague with everything, I'll stick to giving you some general advice about troubleshooting your own problems. I would start looking for problems by adding some relevant print and debug statements before any extrudes which you think are acting up. For example:// Print some stuff! println("roundExtrude"); debug(context, qSketchRegion(id + "startSketch"));<br>println(length); extrude(context, id + "roundExtrude", { "entities" : qSketchRegion(id + "startSketch"), "endBound" : BoundingType.BLIND, "depth" : length });Generic print statements (like println("roundExtrude")) can also be used to quickly check what sections of code are running. If you see one thing printed in the console when you're expecting something else, then you've found your issue.
P.S. You should consider using opExtrude and opBoolean instead of the Onshape extrude feature. They'll perform better and be easier to understand. They're also documented better.Software Developer at Epic SystemsFRC Design Mentor - Team 10553 Orange Overdrive0
Answers
-
Happy to help, but I think I'll need a more specific question or an example of what you mean by "interesting behavior". Maybe manually model what you want to happen, and show what's happening instead?0
-
While using the feature, it seems to only do a through extrusion in some configurations, while only doing blind extrusions in others. But there is no errors or anything, just nothing happens, and this has really puzzled me.FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com0 -
I see you're building a shaft generator for FRC. It might not be a bad idea to take a look at Julia's Shaft FeatureScript, which can be found here.
Since you've been pretty vague with everything, I'll stick to giving you some general advice about troubleshooting your own problems. I would start looking for problems by adding some relevant print and debug statements before any extrudes which you think are acting up. For example:// Print some stuff! println("roundExtrude"); debug(context, qSketchRegion(id + "startSketch"));<br>println(length); extrude(context, id + "roundExtrude", { "entities" : qSketchRegion(id + "startSketch"), "endBound" : BoundingType.BLIND, "depth" : length });Generic print statements (like println("roundExtrude")) can also be used to quickly check what sections of code are running. If you see one thing printed in the console when you're expecting something else, then you've found your issue.
P.S. You should consider using opExtrude and opBoolean instead of the Onshape extrude feature. They'll perform better and be easier to understand. They're also documented better.Software Developer at Epic SystemsFRC Design Mentor - Team 10553 Orange Overdrive0 -
Thanks for your input! I've only started using FeatureScript about 2 weeks ago so I'm still learning a lot! I'll use Julia's Shaft FeatureScript as a reference more. I've been staying away from that a little bit just cause I'd like to learn how to build the Feature myself so that I'm not copying and pasting very much.FRC Team 2471 Designer - Alumni
Seattle Pacific University - Mechanical Engineering
efishg2020@gmail.com0

