Just indication yet, there are still more to do before I can share the alpha code… deadline can not be offered.
Some conditions:
The path should be a curve, in model editing context.
The “road” to where the path will projected to and cut, should be a group containing the edges and faces. Should be that wide to hold the all projection.
“Flat” road, parallel to Z plane. (Perhaps might work with surface)
A cut line will contains more edges - than need to connect the “road cross” edges - according to the curve.
An idea/request that exceeded “something simple” and you found a solution and created the plugin very quickly. Through this plugin, you offer the possibility of replacing the current method that involves the use of three or four plugins/extensions. Very useful for urban planners and landscapers.
second attempt.
Still far away to be called as extension… no error handling, just a bunch of lines after other…, some restriction:
The path should be a curve, in model editing context. and above the road.
The “road” to where the path will projected to and cut, should be a group containing the edges and faces . (The faeces helps to determine the side edges, so currently it is mandatory)
These faces are deleted during the process, but can be recreated…
Path should be that wide to hold the all projection, otherwise will unexpected result.
Works on SketchUp 2020.0 or newer (I guess I can do it for older version too)
You can play with it, copy-paste, the code to Ruby console, select a curve and the road group, then type:
cut_road
You can UNDO it.
BACKUP before you try!
No warranties!
Use at your own risk!
I tested and your code created the necessary geometry to generate the quads.
You managed to create a very useful plugin in a very short time.
Thank you, Dezmo!
Perhaps you already see, but I thought a short summary of how it works might be useful, how to place the road to be cut and the curve. (Currently, that it doesn’t become a disturbing factor, it’s best if you make an empty model … which only has the curve and the road.
A brief summary of how it works:
After determining both side edges and the spokes of the road, broadly speaking, the following happens:
Creating a group with faces generated from the spokes of the road up (1 inch height), paralel to Z_AXIS
Using the facts, the cutting edges are vertical, and the new vertices of cut edges is connected to the user selected side edges, this edges are deleted:
If it’s not more complicated, maybe you’ll add the plugin to your SketchUcation account to be easily discovered by everyone, it’s a very useful plugin.
Regarding the date when you will turn it into a plugin, I read your message when I was on the subway and I wanted to write to you then that, taking into account how fast you worked to create it, it will probably be ready to be published by the time I get home.
The fact that the code and the steps to follow are already published and working is enough, but because you will turn it into a plugin, and seeing the requirements of people in the forum regarding plugins/extensions… menu, toolbar, shortcut will probably be useful.
As it is preferable to have a simple interface for SketchUp and not have to follow the whole screen with the mouse to click on an icon,
the most important thing is to be able to enter a shortcut to activate the plugin. Right click context menu, if you have many plugins, it would probably be more difficult to find/use.
The plugin is so useful that it allows you to create a mountain road more easily, even if it has ‘rest/overtaking areas’ (I think the correct name in English could be slow vehicle bays/lanes) on both sides of the road.
I did another test and, just like yesterday, I found that it is useful for the path to exceed a little at the ends. If it is exactly the length of the road, two triangles appear at the ends instead of four sides (even this is easily solved).
Thanks for feedback!
If the curve is exactly the length of the road, for some reason the last vertical cut line does not created. (There is a reported bug in Intersect Faces - intersect_with method in Ruby - when in some occasion this can happen. Perhaps, this case also involved… I will check later.)
So make you path longer …
Until - perhaps between the big Christmas visit to relatives and after some stuffed cabbage and wine - I make a plugin, just a small advise.
You do not need to copy-paste the code all time. Once you hit the enter it is loading for that season of SU. So you just need to type in the command cut_road after selection and hit Enter.
Moreover, if you click on a console input area and hit the up arrow the last commands is retrieved in a reverse order how its entered.
So click on a console input area hit ↑ then Enter
Thanks for the info!
There’s no rush, Dezmo. Even the code itself because you created and published it (very quickly) is excellent, taking into account that it exceeds a simple code. The fact that you will turn it into a plugin is not a rush.
Small update:
I just made it compatible with SU2017 - but, I did not changed others in a code and I don’t think I will update it anytime soon.
I’ll be honest - because I think it’s right, even if it casts a bad light on me - I somehow lost my intention/interest and can’t bring myself to think about this extension any further… sorry!
… but- at least - you will have e a dirty plugin to be able to install as “normal” rbz.
You will get a menu item in Extension menu “Dezmo Cut Road Quads”, therefore you can assign a shortcut.
Should work same as before. That’s it for now.