2 Replies Latest reply on Aug 16, 2018 10:27 PM by Artem Taturevych

    Creating Swept Temporary Bodies

    Zhen Yan

      I'd like to make temporary bodies by sweeping a circle along edges (IEdge, ISketchSegment, anything along those lines ). I'm trying to compute the Minkowski sum. Basically, making grooves of a certain radius from edges, like an o-ring groove.


      I made a circle curve normal to one of the points of the edge. Then I thought I was going to call either IModeler::CreateSweptBody() or IModeler::CreateSweptSurface(), but turns out, SweptBody() requires you to make selections. Curves can't be selected. Body2::Select2() returns false and indeed selects nothing even after making it a wire body, regardless of whether I made them selectable or not.


      SweptSurface() takes a direction vector. It doesn't look any different than an extrusion.


      I could try CreateLoftSurface() or CreateLoftBody(), but I'd have to generate guide curves that are on the resulting surface, which would defeat the point of doing this to begin with.


      How do I do this?

        • Re: Creating Swept Temporary Bodies
          Zhen Yan

          Since wire bodies are bodies of 1 entity, turns out you can just get the first and only edge within, using IBody2::GetEdges(), select that. Whether it's displayed, or set to non-selectable matters not.


          Feel free to chime in if anybody's got a better solution without making selections, as most of the other IModeler methods works with just Curves and points, no selections necessary

            • Re: Creating Swept Temporary Bodies
              Artem Taturevych

              Hi Zhen,


              I haven't found the good alternative to your solution. But the good thing is you do not need to display this body and you can use API only selection to preselect those objects. So basically this behaves exactly in the same way as is passing the curves (i.e. none of the current user selections affect the sweep operation and no selection or temp bodies are displayed while the sweep operation). You can follow this example: Create Elliptical Swept Temp Body