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.

revolve up to (flat) surface

mko_scmko_sc Member Posts: 24 PRO
revolve up to (flat) surface
I have a closed profile and an axis leaning against a plane
I can revolutionize this closed profile up to a plane (which clearly intersects) and have qCapEntity
I wanted to avoid doing a full revolution, cut it and then select the resulting section.
Thanks
Tagged:

Comments

  • Kira_LeeKira_Lee Member, Developers Posts: 17 PRO
    edited December 2021
    If you know the x vector along your sketch plane (vector1) and the x vector along the flat surface (vector2), you should be able to set the angle between the two as your total revolution angle:
            angle = angleBetween(vector1, vector2);
            opRevolve(context, id + "revolve2", {
                        "entities" : Sketch,
                        "axis" : revAxis,
                        "angleForward" : angle
                    });

  • mko_scmko_sc Member Posts: 24 PRO
    Thanks a lot #Kira_Lee
    however I changed my approach and made an opBoolean fact
                opRevolve(context, id + "revolve1", {
                            "entities" : widget.faccia,
                            "axis" : line(vector(0, 0, 0) * mm, vector(0, 0, -1)),
                            "angleForward" : 170 * degree
                        });
                opExtrude(context, id + "extrude1", {
                            "entities" : widget.entities,
                            "direction" : evOwnerSketchPlane(context, { "entity" : widget.entities }).normal,
                            "endBound" : BoundingType.BLIND, "endDepth" : 50 * mm
                        });
    
                var tools = qUnion([qCreatedBy(id + "extrude1", EntityType.BODY), qCreatedBy(id + "revolve1", EntityType.BODY)]);
    
                opBoolean(context, id + "boolean1", {
                            "tools" : tools,
                            "operationType" : BooleanOperationType.INTERSECTION,
                            "allowSheets" : true
                        });
                debug(context, qCreatedBy(id + "boolean1"), DebugColor.RED);

  • mko_scmko_sc Member Posts: 24 PRO
    I'll test your example anyway
    Thanks again
Sign In or Register to comment.