by renderiza » Sat Oct 19, 2013 7:18 pm
Authors:: Anar | Dan Rathbun | Pilou | Renderiza | TIG Plugin Name:: FaceSplit Version:: 1.0.3 Date:: 11/4/2013 Cost:: Free FaceSplitSplit faces up a variety of ways. This only works as expected on convex faces.
For plugin compatibility it is recommended to instal Internet Explorer 9 or higher.
Available at sketchUcation plugin Storeclick here______________________________________________________________________Web-Dialog

Last edited by renderiza on Mon Nov 04, 2013 6:32 pm, edited 7 times in total.
-

renderiza
- Premium Member

-
- Posts: 797
- Joined: Thu Sep 13, 2012 9:41 pm
- Location: Puerto Rico
- Name: Rafael Rivera
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Advanced
-
by cotty » Sat Oct 19, 2013 9:46 pm
Discussion which leads to this nice plugin...Nice! Thank you. 
-

cotty
- Top SketchUcator
-
- Posts: 3446
- Joined: Fri Feb 12, 2010 1:41 pm
- Location: Germany
- Name: Carsten
- Operating system: Windows
- SketchUp version: 2020
- License type: Pro
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by renderiza » Sun Oct 20, 2013 12:25 am
Thank you for giving a link to the Discussion that started it all. Also here is another that played a big part in optimizing the code. Apart from dividing the face like in the second row of the image, was thinking to add additional options like the ones below that. The trick here is to provide an easy to understand user interface where you can change the options. 
-

renderiza
- Premium Member

-
- Posts: 797
- Joined: Thu Sep 13, 2012 9:41 pm
- Location: Puerto Rico
- Name: Rafael Rivera
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Advanced
-
by mitcorb » Sun Oct 20, 2013 4:54 am
Something like: split by angles to centroid, split by medians to centroid, split by angles to medians, split by angles, medians through centroid? Or, split by bisect angles, bisect edges, ??
I take the slow, deliberate approach in my aimless wandering.
-

mitcorb
- Top SketchUcator
-
- Posts: 4002
- Joined: Sat Mar 22, 2008 2:32 pm
- Location: USA
- Name: mitcorb
- Operating system: Windows
- SketchUp version: 2016
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Intermediate
by renderiza » Sun Oct 20, 2013 5:36 am
mitcorb wrote:Something like: split by angles to centroid, split by medians to centroid, split by angles to medians, split by angles, medians through centroid?
Correct! mitcorb wrote:Or, split by bisect angles, bisect edges, ??
Was not thinking of this option but, if I am not mistaken TIG's TriangulateAllFaces is accomplished this way.
-

renderiza
- Premium Member

-
- Posts: 797
- Joined: Thu Sep 13, 2012 9:41 pm
- Location: Puerto Rico
- Name: Rafael Rivera
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Advanced
-
by glro » Sun Oct 20, 2013 1:36 pm
The purpose of such a plugin may be purely graphical, and all the options mentioned are interesting There is another purpose possible http://www.spatial.com/products/3d-mesh"3D Mesh provides automatic mesh generation for curves, surfaces (triangle and quadrilateral) and volumes (tetrahedral)" sketchup is not a real 3d software, since a volume is only a space closed by surfaces Would it be possible to write a plugin that would do something similar to what 3d mesh does, by drawing lines on the surfaces and between the surfaces 3d mesh may follow different patterns http://www.ansys.stuba.sk/html/guide_55/g-mod/GMOD7.htmThis mesh could be exported to a structural analysis software Might be related to Voxelize http://sketchucation.com/forums/viewtopic.php?t=36063a lot of work, though...
-
glro
-
- Posts: 395
- Joined: Mon Nov 30, 2009 9:45 am
- Location: Spain
- Name: georges louis m le roux
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by iichiversii » Sun Oct 20, 2013 3:15 pm
excellent, ill be using that Thanks for sharing 
Bring on the Rain...
-

iichiversii
- Premium Member

-
- Posts: 1137
- Joined: Mon Apr 27, 2009 6:45 pm
- Location: Tipperary, Ireland
- Name: iichiversii
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Free/Make
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Intermediate
-
by tomot » Sun Oct 20, 2013 8:01 pm
very nice!  I was thinking of an added option also: We now have split from vertex, can we add split from midpoint?
-
tomot
- PluginStore Author

-
- Posts: 706
- Joined: Mon Apr 07, 2008 12:18 am
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Free/Make
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by renderiza » Sun Oct 20, 2013 10:15 pm
Warning!The examples shown below are not features the current version support. These are ideas for possible future updates so please don't be confused by it. From vertices to centeroid (Current function of plugin) Currently the plugin has no problem when dealing with multiple faces because the existing edges are no sliced. We only add new vertex in center of geometry and reuse the existing face vertices after that. From medians to centeroidIn this case we do split the existing edges in half and that cause effect we see in the 3rd row of the image. Each face will exponentially increase the number of edges in which the script will divide causing different results each time. The example in the 2nd row of the image was able to maintain the same amount of edges per face because each color represent a group. Notice none of the same color groups can touch each other.  Conclusion Will have to figure out a way to reproduce the results in the 2nd row of image without having to make multiple groups. Not sure how at the moment but maybe if I open this to discussion in the development forum it can get solved quickly. When I saw the results on row number 3 of image I sort of like what I saw. Maybe this effect is what someone might want who knows. --------------------------------------------------------------glro: That would be ideal for the plugin to reach to that level but first I need to figure out simple stuff like the ones mentioned above. Thanks for your input really appreciate it! iichiversii: Hey long time no see!!! Glad you found a use for it. tomot: Yes above I tried demonstrated some of the issues to solve before adding the feature of splitting from medians to centroid.
-

renderiza
- Premium Member

-
- Posts: 797
- Joined: Thu Sep 13, 2012 9:41 pm
- Location: Puerto Rico
- Name: Rafael Rivera
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Advanced
-
by TIG » Sun Oct 20, 2013 10:30 pm
No need to group ? Collect all of the faces. Then collect points for each of the faces - i.e. the 'center' point and the all of the perimeter points needed. Iterate the points collection - get the 'center' point, then add the new edges from the other points... - Code: Select all
### pseudo-code... faces=[face1, face2, etc] points=[[face1_points_array], [face2_points_array], etc] ### NOW add edges from each fixed set of points points.each{|pts| cpt=pts.shift ### gets/removes 1st point pts.each{|pt| ents.add_line(cpt, pt) } }
TIG
-

TIG
- Global Moderator
-
- Posts: 20369
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by renderiza » Sun Oct 20, 2013 10:58 pm
Thank you TIG will try that ASAP!!! ...TIG's suggestion works! Here is a code sample that you can copy & paste for testing... The only function the code does is to split faces from medians to centroid. - Code: Select all
def csplit() model = Sketchup.active_model ents = model.active_entities sel = model.selection faces = sel.grep(Sketchup::Face) edges = [] avg = [] cl = []
model.start_operation('csplit')
faces.each do |face| edges << face.edges ########### # Medians # ########### lines = face.edges lines.each {|e| e1 = e.start.position e2 = e.end.position x = (e2.x + e1.x) / 2 y = (e2.y + e1.y) / 2 z = (e2.z + e1.z) / 2 cl << Geom::Point3d.new( x, y, z ) } ############ # Centroid # ############ sum = Geom::Point3d.new(0,0,0) verts = face.vertices n = verts.size.to_f verts.each {|v| sum += ORIGIN.vector_to(v.position) } avg << Geom::Point3d.new( sum.x/n, sum.y/n, sum.z/n ) #/ end # each face
############################ # From Centroid to Medians # ############################ faces.each do |face| centroid = avg.shift edges.shift.each {|e| lc = cl.shift ents.add_line( centroid, lc ) } end
model.commit_operation
rescue => e
puts "Error <#{e.class.name}: #{e.message} >" puts e.backtrace if $VERBOSE
model.abort_operation
else # when no errors:
sel.clear
end # csplit()
####### # Run # ####### csplit()
Always welcome suggestion to make code better...cheers! 
Last edited by renderiza on Mon Oct 21, 2013 3:16 am, edited 1 time in total.
-

renderiza
- Premium Member

-
- Posts: 797
- Joined: Thu Sep 13, 2012 9:41 pm
- Location: Puerto Rico
- Name: Rafael Rivera
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Advanced
-
by renderiza » Mon Oct 21, 2013 3:09 am
Look what happens if you test the code above with object similar to the one in image below. If the face has a hole in the middle and is not triangulated or quadrangular like in the 2nd row the result can be messy. The second row show much better result because the first object had quad face before applying script. 
Hope this helps.
-

renderiza
- Premium Member

-
- Posts: 797
- Joined: Thu Sep 13, 2012 9:41 pm
- Location: Puerto Rico
- Name: Rafael Rivera
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Advanced
-
by TIG » Mon Oct 21, 2013 10:16 am
I was about to tell you of the issue with faces with holes or L shapes having a centroid 'off-face', but you have displayed it already... Here is the 'fix'... As you iterate each face check face.classify point(cpt)If it is not on the face, on a face-edge or on a face-vertex then do this: tr=Geom::Transformation.new() es=ents.intersect_with(false, tr, ents, tr, true, ents.to_a)You could reduce the intersected array to say face.edges provided you have a reference to the face ? Then if some edges collected into 'es' remain 'unfaced' use this to erase them? : es.grep(Sketchup::Edge).each{|e|e.erase! unless e.faces[0]} 
TIG
-

TIG
- Global Moderator
-
- Posts: 20369
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by pilou » Mon Oct 21, 2013 10:19 am
Bravo! Some testings in view and some track the bugs! Ps you are very friendly to have put my name but take attention that I have not made any code just a little moment of inspiration (given by a French guy anar! 
-

pilou
- Top SketchUcator
-
- Posts: 22858
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by anar » Mon Oct 21, 2013 10:44 am
Pilou wrote:Bravo! Some testings in view and some track the bugs! Ps you are very friendly to have put my name but take attention that I have not made any code just a little moment of inspiration (given by a French guy anar! 
Thanks Pilou for mentioning that I started that discussion with you here : http://www.polyloop.net/showthread.php/ ... /page7#133And thanks also because without you that plugin would have never been made ! Anar http://www.reppersdelight.spacymen.com
-
anar
-
- Posts: 34
- Joined: Wed Jun 11, 2008 11:45 am
- Location: France
- Name: anar
- Operating system: Windows
- SketchUp version: 2015
- License type: Free/Make
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Advanced
-
by glro » Mon Oct 21, 2013 12:59 pm
renderiza wrote:Look what happens if you test the code above with object similar to the one in image below. If the face has a hole in the middle and is not triangulated or quadrangular like in the 2nd row the result can be messy. The second row show much better result because the first object had quad face before applying script. 
Hope this helps.
i thought it was only for surfaces, but i see that it works on volumes also... would it be possible to split the volume following the liness making like a 3d puzzle? this would mean adding surfaces following the lines to make independant volumes like "voxelize.rb", but not only cubes
-
glro
-
- Posts: 395
- Joined: Mon Nov 30, 2009 9:45 am
- Location: Spain
- Name: georges louis m le roux
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by pilou » Mon Oct 21, 2013 5:05 pm
Seems working fine 
-

pilou
- Top SketchUcator
-
- Posts: 22858
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by pilou » Mon Oct 21, 2013 5:16 pm
And all medians are present!  I don't want imagine the possibilities in 3D! faceclip1.jpg
-

pilou
- Top SketchUcator
-
- Posts: 22858
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by renderiza » Mon Oct 21, 2013 6:10 pm
TIG: Thank you TIG will test that out effective immediately! Pilou & Anar: People that bring ideas to the table deserve recognition as well. glro: That would be very cool indeed! I think there is a plugin that does something like this but don't remember it just now. If I find it will let you know. Pilou: Very cool! 
-

renderiza
- Premium Member

-
- Posts: 797
- Joined: Thu Sep 13, 2012 9:41 pm
- Location: Puerto Rico
- Name: Rafael Rivera
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Advanced
-
by Pixero » Mon Oct 21, 2013 8:16 pm
Hi! May I suggest an addition. For people working in 3ds Max a imported SketchUp model is sometimes hard to work with because it doesn't consist of evenly sized quad faces. I have this idea to be able to split a face with inner loops like windows by projecting lines in the direction of the edges to the outer loop. See this quick sketch. image.jpg
-

Pixero
-
- Posts: 2595
- Joined: Thu May 24, 2018 12:49 pm
- Location: Halmstad, Sweden
- Name: Pixero
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by glro » Mon Oct 21, 2013 8:18 pm
renderiza wrote:.. [b]glro: That would be very cool indeed! I think there is a plugin that does something like this but don't remember it just now. If I find it will let you know. :
Maybe you think also to voxelize.rb http://sketchucation.com/forums/viewtopic.php?t=36063but voxelize makes cubes only; it would be funny to split the volume in exact sub-volumes, and try to build the whole volume back again, using sketchup i have a 3d connexion mouse, and there is a game like this, to learn how to use it and in addition, splitting a volume in sub-volumes is equivalent to building a 3d mesh, for structural analysis...
-
glro
-
- Posts: 395
- Joined: Mon Nov 30, 2009 9:45 am
- Location: Spain
- Name: georges louis m le roux
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by renderiza » Mon Oct 21, 2013 9:11 pm
Pixero wrote:I have this idea to be able to split a face with inner loops like windows by projecting lines in the direction of the edges to the outer loop.
This is excellent idea! It will produce the cleanest geometry possible before dividing it even more. glro wrote:Maybe you think also to voxelize.rb http://sketchucation.com/forums/viewtopic.php?t=36063but voxelize makes cubes only; it would be funny to split the volume in exact sub-volumes, and try to build the whole volume back again, using sketchup i have a 3d connexion mouse, and there is a game like this, to learn how to use it and in addition, splitting a volume in sub-volumes is equivalent to building a 3d mesh, for structural analysis...
The plugin I had in my mind was not voxelize...it was one that only worked if you had SketchUp Pro. Anyways making a plugin like this would be cool indeed. Not sure if I possess the knowledge to do it myself at the moment but will see if I can experiment with the idea in the future.
-

renderiza
- Premium Member

-
- Posts: 797
- Joined: Thu Sep 13, 2012 9:41 pm
- Location: Puerto Rico
- Name: Rafael Rivera
- Operating system: Windows
- SketchUp version: 2022
- License type: Pro
- SketchUp use: game and/or sci-fi modelling
- Level of SketchUp: Advanced
-
by pilou » Mon Oct 28, 2013 11:54 am
Sure a video will give some ideas to users!  What are the natures of the up date ? diamond.jpg 
-

pilou
- Top SketchUcator
-
- Posts: 22858
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by guanjin » Mon Oct 28, 2013 5:43 pm
我点击图标,没有任何反应!
I come from China, is to learn
-

guanjin
-
- Posts: 242
- Joined: Thu Apr 08, 2010 6:52 am
- Name: guanjin
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Free/Make
- SketchUp use: interior design
- Level of SketchUp: Intermediate
-
by cotty » Mon Oct 28, 2013 7:52 pm
guanjin wrote:我点击图标,没有任何反应!
You should click after you have selected one or more faces.
-

cotty
- Top SketchUcator
-
- Posts: 3446
- Joined: Fri Feb 12, 2010 1:41 pm
- Location: Germany
- Name: Carsten
- Operating system: Windows
- SketchUp version: 2020
- License type: Pro
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by guanjin » Tue Oct 29, 2013 4:04 am
cotty wrote:guanjin wrote:我点击图标,没有任何反应!
You should click after you have selected one or more faces.
999999999999999999.gif I have tried。 Thank you
I come from China, is to learn
-

guanjin
-
- Posts: 242
- Joined: Thu Apr 08, 2010 6:52 am
- Name: guanjin
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Free/Make
- SketchUp use: interior design
- Level of SketchUp: Intermediate
-
by 120711014 » Tue Oct 29, 2013 9:26 am
thanks for sharing~~~~~~~~
-
120711014
-
- Posts: 2
- Joined: Mon Jul 29, 2013 9:47 am
- Name: CXF
- Operating system: Windows
- SketchUp version: 2013
- License type: Free/Make
- SketchUp use: education
- Level of SketchUp: Intermediate
by Ulimann » Wed Oct 30, 2013 8:38 pm
I have tried but no success,to get this plugin to work.I have reinstalled a few times! Running SU 8 Pro on Windows 7. Any suggestion to get it working?
-
Ulimann
-
- Posts: 4
- Joined: Wed Jan 26, 2011 12:01 pm
- Name: Uli Wichmann
- Operating system: Windows
- SketchUp version: pre-2013
- License type: Pro
- SketchUp use: product design
- Level of SketchUp: Intermediate
by erikB » Wed Oct 30, 2013 10:01 pm
same here. also SU8 pro and win 7 (64) I also think I have all the administrator rights set on every subdirectory. Strange, I can see the icon but can not click on it nor can I change the number. erikB
-

erikB
-
- Posts: 117
- Joined: Mon Dec 03, 2007 5:22 pm
- Location: Belgium
- Name: Erik Bosquet
- Operating system: Windows
- SketchUp version: 2016
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Plugins
|