Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
"Retrieve" trailing edge resulting from EDGE extrusion
mko_sc
Member Posts: 27 PRO

I apologize in advance for any nonsense or simplicity.
how do i retrieve the terminal wire of an edge extrusion?
I need to retrieve the 2 end points to draw other things.
Thanks
precondition
{
annotation { "Name" : "Curve", "Filter" : EntityType.EDGE || EntityType.BODY && BodyType.WIRE }
definition.Skizzo is Query;
annotation { "Name" : "Face", "Filter" : EntityType.FACE,"bodyType" : ToolBodyType.SURFACE }
definition.Faccia is Query;
}
{
opExtrude(context, id + "extrude1", {
"entities" : definition.Skizzo ,
"direction": evOwnerSketchPlane(context, {"entity" : definition.Skizzo}).normal,
"endBound" : BoundingType.UP_TO_SURFACE,
"endBoundEntity" : definition.Faccia
});
var piano = newSketch(context, id + "sketch", {
"sketchPlane" : qCreatedBy(id + "extrude1", EntityType.FACE)
});
//???????????????????????????????
var endPoint is Query = qCreatedBy(id + "extrude1");
var startPosition is Vector = evVertexPoint(context, {"vertex" : qNthElement(endPoint, 1) });
debug(context,endPoint);
debug(context, startPosition);
//???????????????????????????????
});0
Comments
then I don't understand why the CapType seems correct when I set it to START while it should be END
Thanks
https://cad.onshape.com/documents/0c64fef5e971bca634d38f9f/w/2d55e179cdb15b3a8d661d86/e/a2ca94fc2759ce4bf3c1627d
precondition { annotation { "Name" : "Curva", "Filter" : EntityType.EDGE || EntityType.BODY && BodyType.WIRE } definition.Skizzo is Query; annotation { "Name" : "Accia", "Filter" : EntityType.FACE,"bodyType" : ToolBodyType.SURFACE } definition.Faccia is Query; } { opExtrude(context, id + "extrude1", { "entities" : definition.Skizzo , "direction": evOwnerSketchPlane(context, {"entity" : definition.Skizzo}).normal, "endBound" : BoundingType.UP_TO_SURFACE, "endBoundEntity" : definition.Faccia }); var piano = newSketch(context, id + "sketch", { "sketchPlane" : qCreatedBy(id + "extrude1", EntityType.FACE) }); var CapEnti is Query = qCapEntity(id + "extrude1", CapType.START); var risu is Query = qGeometry(CapEnti, GeometryType.OTHER_CURVE); //??// var Pos1 is Vector = evVertexPoint(context,{"vertex" : qNthElement(risu, 0)}); //debug(context,CapEnti); debug(context,risu); //debug(context,Pos1); skSolve(piano); });do I have to "redesign" it with skEllipticalArc or how?
Thanks
https://cad.onshape.com/documents/5bc75a5ed5ddc798b43cdf2a/w/1f899b34d7278eee6d1be959/e/75d62d635744761d1933092e
<div>opExtrude(context, id + "extrude1", { "entities" : definition.Skizzo, "direction" : evOwnerSketchPlane(context, { "entity" : definition.Skizzo }).normal, "endBound" : BoundingType.UP_TO_SURFACE, "endBoundEntity" : definition.Faccia }); var QPiano is Query = qCreatedBy(id + "extrude1", EntityType.FACE); var BordoVoluto = qSubtraction(qGeometry(qCapEntity(id + "extrude1", CapType.START, EntityType.EDGE), GeometryType.OTHER_CURVE),definition.Skizzo); debug(context, BordoVoluto); var endPoints is Query = qAdjacent(BordoVoluto, AdjacencyType.VERTEX, EntityType.VERTEX); var startPosition is Vector = evVertexPoint(context, { "vertex" : qNthElement(endPoints, 0) }); var endPosition is Vector = evVertexPoint(context, { "vertex" : qNthElement(endPoints, 1) }); var ellisse is map = evCurveDefinition(context, {"edge" : BordoVoluto}); //-Crea una map del risultato var xDirection is Vector = normalize(endPosition - startPosition); var zDirection is Vector = perpendicularVector(xDirection); var cSys is CoordSystem = coordSystem(startPosition, xDirection,zDirection); //debug(context, cSys); var sketchPlane is Plane = plane (cSys); var lunghezza is ValueWithUnits = norm(endPosition - startPosition); var sketch1 = newSketchOnPlane(context, id + "sketch1", { "sketchPlane" : sketchPlane }); skLineSegment(sketch1, "line1", { "start" : vector(0, 0) * millimeter, "end" : vector( 0 * millimeter, -5 *millimeter) }); skLineSegment(sketch1, "line2", { "start" : vector( 0 * millimeter, -5 *millimeter), "end" : vector(lunghezza+0 * millimeter, -5 *millimeter) }); skLineSegment(sketch1, "line3", { "start" : vector(lunghezza+0 * millimeter, -5 *millimeter), "end" : vector(lunghezza+0 *millimeter, 0 * millimeter) }); skLineSegment(sketch1, "line0", { "start" : vector(lunghezza+0 *millimeter,0 * millimeter), "end" : vector(0, 0) * millimeter, "construction" : false }); skSolve(sketch1);<br></div>Something like opFillSurface(... qUnion(qCreatedBy(id + "sketch1", EntityType.EDGE), BordoVoluto) ...)
You can use that created surface for any downstream operation, and delete it afterwards if you wish.
Would that work?
i’m a building a plate , I need,now, to find the parallel line from “startPosition” to “endPosition” and tangent to the elliptical line
thanks
but failing to get the "opFillSurface" command to work all night. and I was ashamed to ask ...;)
i slept all night and i just did:
<div> var sketch2 = newSketchOnPlane(context, id + "sketch2", { "sketchPlane" : sketchPlane });<div> skLineSegment(sketch2, "line0", {</div><div> "start" : vector(0 * millimeter, -definition.hdia + 1 * millimeter),</div><div> "end" : vector(lunghezza + 0 * millimeter, -definition.hdia + 1 * millimeter)</div><div> });</div><div> skSolve(sketch2);</div><div><br></div><div> var opplacca = opExtrude(context, id + "extrude1", {</div><div> "entities" : qCreatedBy(id + "sketch2", EntityType.EDGE),</div><div> "direction" : yAxis(sketchPlane), //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<important</div><div> "endBound" : BoundingType.UP_TO_SURFACE,</div><div> "endBoundEntity" : definition.Faccia</div><div> });</div><div> var Contorno2 is Query = qCreatedBy(id + "extrude3", EntityType.FACE);</div><div> opExtrude(context, id + "extrude4", {</div><div> "entities" : Contorno2,</div><div> "direction" : zzDirection,</div><div> "endBound" : BoundingType.BLIND,</div><div> "endDepth" : x * millimeter</div><div> }); </div></div>I practically draw a line on 2 points now known and re-extruded this line on the same surface and I solved the problem!the desired distance is missing (2mm) .. but for this I try something like "maximum distance" from the edge.
(if you have some help for the tangent it is appreciated)
parallel to:
<div>var sketch2 = newSketchOnPlane(context, id + "sketch2", {</div><div> "sketchPlane" : sketchPlane</div><div> }); </div>and tangent to:<div> var CapEntiCurva is Query = qGeometry(CapEnti1, GeometryType.OTHER_CURVE); //spline elliptical result</div><div> var ellisse is map = evCurveDefinition(context, { "edge" : CapEntiCurva }); //map of the result <br></div>now! ,I can't understand how "opFillSurface" works, is there an example something I can study?
thanks
and sorry for my writing! google translator is live