![]() Send in an array with all the faces in your solid and you should get a correctly oriented start face in return. Return max_f.normal.z < 0 ? max_f.reverse! : max_f I think something like the below will work: def self.get_start_face(ents) The only problem remaining is to find a start face and orient it correctly. There’s no limit to the number of sides a SketchUp face can have, though. Because you need at least three straight lines to make a closed shape, faces must have at least three sides. ![]() Return edge.faces = face ? edge.faces : edge.faces What is a face in SketchUp In other words, a face is defined by the edges that surround it, and those edges all have to be on the same, flat plane. What is a face in SketchUp In other words, a face is defined by the edges that surround it, and those edges all have to be on the same, flat plane. Next if face1.nil? || processed.include?(face1) Something like: def self.orient_faces(start_face) What you need is something like a flood fill, that is, you start with a correct face and then you unwind the geometry from there, reaching new faces from faces already processed and so on. I don’t think that will work because you just randomly access the faces in your face array. Slightly compressed, yields this block of code: Pendrive Courses Are Available in tamil1.AUTOCAD 2017 (duration 8.15hours)2.3DS MAX 2016 WITH VRAY (duration 9.54hour)3.SKETCHUP 2020 WITH VRAY (duration 8.2. Thus, if we start with a face that we know is correctly oriented we can orient all other faces in the solid consistently by unwinding the geometry from the start face. Face orientation affects rendering, 3D printing, and more. If face1 uses the common edge in the same direction as face0, then it must be reversed. In this video, we talk about the importance of using the front and back sides of faces in SketchUp. That is, we know that face0 is correctly oriented. This code reverse face1 if we have the situation in the second image. For a solid to be consistently oriented, then for every edge the two connected faces must use the edge in opposite directions.įace1.reverse! if edge.reversed_in?(face0) = edge.reversed_in?(face1) In order for BOTH faces to be correctly oriented the face loops at the edge must use the edge in opposite directions. If you look in the first image below, there are two faces sharing an edge. If the face loop is counter clockwise as seen from the camera you will see the front material. Here is a snippet from a previous post that I am still wrapping my head around how it is supposed to work:Ī face is oriented according to its face loop.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |