Get Lines of a Sketch and angle between 2 lines with coincident vertice.
emerson_bottero
Member, Developers Posts: 37 ✭✭
I couldn't find an evLine that works with an sketch.
var sketch1 = newSketchOnPlane(context, id + "sketch1", {
"sketchPlane" : newPlane
});
skRectangle(sketch1, "rectangle1", {
"firstCorner" : vector(-1/2,-1/2) * inch,
"secondCorner" : vector(1/2, 1/2) * inch
});
I want to implement something like an sketchFillet and it will fillet all vertices in any closed polygon. Given the radius and the angle between two lines I can calculate the rest.
I want to implement something like an sketchFillet and it will fillet all vertices in any closed polygon. Given the radius and the angle between two lines I can calculate the rest.
Tagged:
0
Best Answer
Answers
-
The answer I typically see from OS is that there is little you can do with sketches via FeatureScript. The best you can do is just lay out lines and arcs with predefined endpoints and sizes based on math that you've already worked out in your code. Now, if you want to make life easier by implementing a custom sketch filleting function that you can use within your featurescript, I can see how that would be handy. As for measuring angles, you can easily work that out in your code since you know the location of the 3 vertices.
For vertices A,B,C, with C being the center:angle = atan(A[1] - C[1], A[0] - C[0]) - atan(B[1] - C[1], B[0] - C[0]);
0 -
But only with points I can't differ edges from diagonals. If I could makes a for each line in sketch loop I could do the rest. But I could not find the correct query.0
-
How are you generating the sketch lines? If you're using skRectangle, then you already know the angle is 90deg. Not to mention you would already have all the XY info from firstCorner and secondCorner. If you're using skLineSegment, then you already have all the point information because it's required to use the function anyway. What is the scenario where you can't extract the point information?0
-
@emerson_bottero
I don't think one can write a sketchFillet tool in FeatureScript.
It is fairly easy to write a feature which accepts a face and produces a surface with geometry of this face with filleted corners.
0 -
@lana, you can't write a sketchFillet featurescript, but you can write a function internal to a Featurescript. Although, at this point I'm still not clear what exactly @emerson_bottero is trying to accomplish ¯\_(ツ)_/¯0
-
Feature script does not have any means of querying sketch or geometry of its entities. From FS point of view the geometry of sketch is not specified until skSolve() is called. After that query qGeometry(qBodyType(qCreatedBy(sketchId, EntityType.EDGE), BodyType.WIRE), GeometryType.LINE) would give you all the lines in sketch
0 -
@mahir I want a function, as you said. I'm trying to make a feature to extrude a sketch with I can controle easily the dimension and shapes, I will try wath @lana sujested, but can I change the sketch after the skSolve() call?mahir said:@lana, you can't write a sketchFillet featurescript, but you can write a function internal to a Featurescript. Although, at this point I'm still not clear what exactly @emerson_bottero is trying to accomplish ¯\_(ツ)_/¯
0 -
Yep, what @lana said. If your intention is to simplify sketches for extrusions and apply fillets later, then using opFillet on model edges is the way to go. Once you have 3D geometry to work with, you can now leverage the vast library of queries to select and process the specific corners you want to fillet.0


