Open mxmws opened 2 months ago
Personally I use BoxSelector
, like this
faces = cq_object.faces(cq.selectors.BoxSelector(corner0, corner1, boundingbox=True))
to select objects having the same, or contained in, bounding boxes.
Personally I use
BoxSelector
, like thisfaces = cq_object.faces(cq.selectors.BoxSelector(corner0, corner1, boundingbox=True))
to select objects having the same, or contained in, bounding boxes.
Thank you, this is helpful! Do you have any idea how I could do the same for cylinders?
Maybe comparing areas and centers with
center = face.val().Center().toTuple()
area = face.val().Area()
Personally I use
BoxSelector
, like thisfaces = cq_object.faces(cq.selectors.BoxSelector(corner0, corner1, boundingbox=True))
to select objects having the same, or contained in, bounding boxes.
Thank you again, this works. But how can I select the remaining surfaces? "not" doesn't work. Basically I want to show all surfaces but color the selected ones.
You could get a list of all surfaces with faces = cq_object.faces().vals()
and then remove from this list the selected ones. That would leave you with a list of not selected surfaces.
I imported a 3D part from a step file. Addionally I have parameters for the following surfaces:
I would like to find all faces in my part that are either coplanar to my plane or concentric and equal in radius to my cylinder surface.
My idea was to iterate over all faces and compare their parameters with the plane/cylinder I have. Is there a better way to do this and if no, how do I iterate over the faces of my part?