relume Posted March 2, 2020 Share Posted March 2, 2020 Hello For external geometrical processing in a python script, every VW polygon that has one or more curved vertices has to be converted to an approximated "lines only" polygon. This represents the standard transformation for any curved vortex on exporting VW objects by the export function to the Shape-Geodata format. There is also an VW-menu functionality, that converts a polygon to a multi-line group, where curved vertices were approximated by as many needed short lines. At the moment I can not see, how I can get/convert to such a "lines only" polygon by a VS function. The idea is the following: get the handle of the VW polygon. test if there is one or more curved vertices by looping through all vertices of the polygon (using vs.GetPolylineVertex). if there is any curved vertex in the referenced polygon, make a temporal copy of the original polygon and convert this copy to a "lines only" polygon. process the "lines only" polygon as needed in the python script Step 3. is the operation I am interessted in – a "fast" and VW internal converting operation to a "lines only" polygon or a group of lines. Many thanks in advance for any hint, best regards, relume Quote Link to comment
MullinRJ Posted March 3, 2020 Share Posted March 3, 2020 (edited) @relume , Use: def vs.ConvertToPolygon(h, resolution): return HANDLE Setting integer "resolution" higher creates more vertices. Notes: 1) This function creates a duplicate object, so you don't have to duplicate it beforehand. 2) If the original is selected, the duplicate will be selected, and vice versa. 3) Magic numbers for the resolution are powers of 2. Raymond Edited March 3, 2020 by MullinRJ Quote Link to comment
relume Posted March 3, 2020 Author Share Posted March 3, 2020 @MullinRJ Many thanks four your hint! It seems that I did not seek the VS functions in deep 🙄. The vs.ConvertToPolygon(h, resolution) is perfect. relume Quote Link to comment
MullinRJ Posted March 3, 2020 Share Posted March 3, 2020 You're welcome. I like the easy answers. You get full credit, just for using your memory. 😉 Raymond Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.