revolve up to (flat) surface

mko_sc
mko_sc Member Posts: 27 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_Lee
    Kira_Lee Member, Developers Posts: 17 ✭
    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_sc
    mko_sc Member Posts: 27 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_sc
    mko_sc Member Posts: 27 PRO
    I'll test your example anyway
    Thanks again