Dear STKO support team,
I would like to ask a question utilizing python API in STKO for modifying a given geometry.
Attached is a figure illustrating what I want to achieve and
here is the description on it.
What I would like to do is that
Add a new point (red or blue) and replace/change the vertex 1 with red or blue point.
Or, if this works, this way would be better. I want to move vertex 1 to red or blue point within the current geometry.
This means that I want to change the slope angle of the given geometry.
For instance, vertex 1 (current geometry) corresponds to slope angle of 30 Degrees.
Red point is for slope angle of 40 Degrees and blue point is for the angle of 20 Degrees)
I noticed that this can be done by using PyMpc in STKO.
When referring to https://asdeasoft.net/stko-wiki/page5.html#sec18,
I could see the example creating a new element,
but I could not find any helpful comment to move the vertex and merge it with the current/given geometry
In addition, I want to change the height of the geometry from 15m to 30m,
meaning that all the points in the right side of vertex 1 need to move upward.
If there is more steps to change the height compared to modifying the slope angle (the above question),
please add more comments to this question, too.
Best,
Youngkyu
Question about modifying vertex in a given geometry using python API
-
youngkyu
- Posts: 52
- Joined: Tue May 04, 2021 3:36 pm
- Location: 2559, Gyeongsang-daero, Sangju-si, Gyeongsangbuk-do, Korea
Question about modifying vertex in a given geometry using python API
- Attachments
-
- Figure_for_Question.png (236.52 KiB) Viewed 2456 times
-
marafini.f
- Posts: 363
- Joined: Fri Nov 13, 2020 1:52 pm
Re: Question about modifying vertex in a given geometry using python API
Dear youngkyu,
In the Python API is possible to automize all possible operations of STKO. The thing you are asking, moving a vertex of an existing geometry is not something that STKO does, no even via user input in the interface. When you create a face with the commands in the geometry tab, you will see it's not possible to select a vertex and move it.
This is because STKO is based on the concept of boundary representation, every geometry is defined by its boundaries and they are bound together, it's not possible to stretch them.
Varying the height of an existing geometry is possible throughout the use of the Scale command in the interface, but I would not suggest doing it through the API, maybe we can see what Massimo has to say about it.
What you can do is recreate the geometry you have through the API, or even parametrize the point position and the height of your face, but you'll anyway have to recreate the geometry itself.
You can try with the functions in the example you mentioned to create the geometry of the new faces and we can help you fix your code if something is not working.
Let us know how it goes and I'll tell you if we come up with more ideas here.
Enjoy your programming
Francesca
In the Python API is possible to automize all possible operations of STKO. The thing you are asking, moving a vertex of an existing geometry is not something that STKO does, no even via user input in the interface. When you create a face with the commands in the geometry tab, you will see it's not possible to select a vertex and move it.
This is because STKO is based on the concept of boundary representation, every geometry is defined by its boundaries and they are bound together, it's not possible to stretch them.
Varying the height of an existing geometry is possible throughout the use of the Scale command in the interface, but I would not suggest doing it through the API, maybe we can see what Massimo has to say about it.
What you can do is recreate the geometry you have through the API, or even parametrize the point position and the height of your face, but you'll anyway have to recreate the geometry itself.
You can try with the functions in the example you mentioned to create the geometry of the new faces and we can help you fix your code if something is not working.
Let us know how it goes and I'll tell you if we come up with more ideas here.
Enjoy your programming
Francesca