Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

New Features: Primitives!

EvanReeseEvanReese Member, Mentor Posts: 2,081 ✭✭✭✭✭
edited September 2021 in General
I recently felt motivated to pick Featurescript back up after a little hiatus, so I came up with a project. I often wanna just throw some shapes out there for a demo or test, and I don’t like having to make a sketch and extrude or revolve it, so I made features for Cubes (and cuboids), Cones (and cylinders), and Spheres (and ellipsoids). As per usual, I went ahead and got carried away, so you can pick as many centers as you want to make a lot of them at once, and you can boolean them with other things, which has actually been more useful than I thought. check ’em out:
https://cad.onshape.com/documents/a81f647d405a78c5b70bdbde/v/e3e1283a3840df1bd2c906c5/e/2296a8096d894399aaf299e0

Oh, and hats off to @Alex_Kempen for showing me some more efficient ways to write some parts of these. Thanks, Alex.

Happy Friday, everyone!


Evan Reese

Comments

  • MichaelPascoeMichaelPascoe Member Posts: 1,952 PRO
    edited September 2021
    Legit!

    "It's Frieeday"

    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • Toshimichi_OdaToshimichi_Oda OS Professional Posts: 53 PRO
    私が使いたくて作った FS は次のものです。
    I made a featurescript 'cuboid' because I want to use it.


    人が違えば欲しい物も違います。
    Differnt person wants differnt things.

    FSの予約された名前一覧はありますか
    Is there a list of  'resereved ' feature names ?

    多くの人が、これまでもこれからも 'cuboid' という同じFS名 'cuboid' で
    作るでしょう。
    Many people have made and will make  the same feature script name 'coboid'.

  • EvanReeseEvanReese Member, Mentor Posts: 2,081 ✭✭✭✭✭
    @Toshimichi_Oda
    I like your implementation. Thanks for sharing. I agree that there will likely be some duplicate names, especially as time goes on. I'm not sure of a good way to handle it.
    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,081 ✭✭✭✭✭
    edited September 2021
    Updates in V10. 
    • I've added another feature called Prism, which works like the cone/cylinder but with polygons instead of circles.
    • I've made it possible to link the length and diameter vales on Cone and Prism to make it easier to get symmetrical outputs
    https://cad.onshape.com/documents/a81f647d405a78c5b70bdbde/v/e3e1283a3840df1bd2c906c5/e/2296a8096d894399aaf299e0
    Evan Reese
  • chadstoltzfuschadstoltzfus Member, Developers, csevp Posts: 139 PRO
    I also have my own take on a "Cuboid" custom feature. This one is more akin to how the FeatureScript function fCuboid() works. It's mainly used to create a physical bounding box or to create a cuboid off of max/min points. I find myself using this more in other custom features. https://cad.onshape.com/documents/74c1c4ad0d068297edd8bf97/w/d7b7ed870bad2187587263e5/e/9d26a73ea318fae457695d6d
    Applications Developer at Premier Custom Built
    chadstoltzfus@premiercb.com
  • MichaelPascoeMichaelPascoe Member Posts: 1,952 PRO
    edited September 2021
    Idea: I think it would be cool if you combined these features into one. You could call it "Shapes" and the user could select which shape they wanted from a drop down..?

    Learn more about the Gospel of Christ  ( Here )

    CADSharp  -  We make custom features and integrated Onshape apps!   cadsharp.com/featurescripts 💎
  • EvanReeseEvanReese Member, Mentor Posts: 2,081 ✭✭✭✭✭
    Idea: I think it would be cool if you combined these features into one. You could call it "Shapes" and the user could select which shape they wanted from a drop down..?
    I think it's a great idea depending on the priorities one chooses for the feature set. My self-inflicted brief for these was to make the feature I could use as quickly as possible, since for anything complex, I'll probably want to just use standard tools to have more control anyway. I initially considered making them all as one feature with enums to select between them, and I have considered adding other shapes etc, but I'm consciously fighting feature creep on these. That's what lead me to make 4 separate features, so I can use "option c" to just type the name, and it will automatically create the shape I want at the origin without having to pick from a dropdown.

    Feel free to borrow as much of the Primitives code as you want to make the Shapes feature if you feel like it.
    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,081 ✭✭✭✭✭
    I also have my own take on a "Cuboid" custom feature. This one is more akin to how the FeatureScript function fCuboid() works. It's mainly used to create a physical bounding box or to create a cuboid off of max/min points. I find myself using this more in other custom features. https://cad.onshape.com/documents/74c1c4ad0d068297edd8bf97/w/d7b7ed870bad2187587263e5/e/9d26a73ea318fae457695d6d
    Nice! I know I've seen this one around, but didn't realize it was yours. I imagine there are a ton of cuboids floating around esp since it's such an approachable first feature for people to write.
    Evan Reese
  • Toshimichi_OdaToshimichi_Oda OS Professional Posts: 53 PRO
    多機能フィーチャーの多数の入力欄は、使う人が困惑する可能性があります。
    最初に1つのソリッドを作成してから、他の位置にコピーするのは簡単な方法です。
    別々の位置に複数のプリズムを配置した後、プリズムから他の形状(八面体など)に入れ替えたいとしたらどうしますか?

    座標系を使用して既存のソリッドの境界ボックスを作成する場合、私の新しいFS機能は使いやすいと思います。

    Many input fields of a multifunctional feature may be confused by a user.
    It is easy way that at first making one solid then copy it to other positions.
    After placing prisms in each position, if you  want to exchange from prisms to other shape(ex. octahedrons), how to do?

    I think when making a box bounding of existing solids with a coordinate system, my new FS-feature is friendly.



Sign In or Register to comment.