[Plugin] Slicer v4.3 20110619

[Plugin] Slicer v4.3 20110619

Postby TIG » Fri Dec 21, 2007 7:31 pm

Moved from the 'Roof' thread...
matt77 wrote:Excellent Script. Many thanks -- works a treat for me!!!
I must commend you also on another of your scripts that I find invaluable at work. It's your slicer ruby. It comes in very handy for working out the floor space across very large master-plan massing models. It has saved me so much time. Thank you. I'm not sure it was ever intended for this, but if you set the floor to ceiling height say 3 metres, but don't give the slices any thickness, then run the script across a large grouped area of buildings then explode the floor slabs within the main group, by using the area tool with all faces within that group selected you get a total floor space for that whole area. You may have to delete the top slices so that you don't include the roofs. But very, very handy indeed...
Whilst using your most recent roof script I was impressed in the way that you could assign a material and a layer to the new roof.
I have a request. (Not that your not busy enough as it is)
Is it possible to implement this within in the slicer ruby? So that the when you create the new slices you have an option of also assigning a material to the new slices. In this way you could have separate materials for residential, commercial and retail space. This information regarding the areas assigned to the materials could be then exported to an excel sheet. Giving you a detailed breakdown very quickly regarding your model.
Matt

A few months ago we started using Slicer.rb for exactly the same thing - to get a rough idea of the floor-space in massing blocks on master-plans [although its original use was for making 3D card models from a Sketchup volume - cheap 3D-printer !]
Not so long ago I added a make your own layer and pick materials on the fly option to VolumeCalculator.rb. Since this a son (or perhaps grandson ?) of Slicer it'll be pretty easy to implement (I hope)... I'll add it to the list of things to do.

Here's an updated version - there's a more wide-ranging version on the back-burner [making components of slices etc]... but this one fixes some glitches to ensure that if your 3d form is not properly 'solid' at least each slice get made without the tool 'stalling' - even it some slices don't form/face/extrude/etc as hoped...
    Copyright 2005-2011, TIG

    Permission to use, copy, modify, and distribute this software for
    any purpose and without fee is hereby granted, provided the above
    copyright notice appear in all copies.

    THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

    #-----------------------------------------------------------------------
    Name : Slicer.rb

    Description : A tool to 'Slice' up a volume - useful in real-model
    making and finding likely areas in master plan volumes...

    Menu Item : Plugins -> Slicer

    Context Menu: See menu-section at end on how to include it here: Slicer

    Author : TIG

    Usage : First select a Group or Component that has faces that
    form a volume, then use the Plugins Menu Item 'Slicer': you can aso
    pick the right-click Context-Menu and choose 'Slicer' IF you have
    enabled it (see menu-section at end)...

    A dialog asks for the Slice spacing, the Slice thickness and the
    Slice orientation (XYZ). The units are in current units...
    Entering 0 thickness makes just a face. Entering negative
    values reverts to default. Entering spacing less than thickness
    reverts to default. It also asks for the the Layer and Colour
    of the Slices. The layer choices are 'Layer0' (or <Default> in your
    local langauge), a unique name 'SLCE-nnnnnnn' (it will then make a new
    layer named 'SLCE-nnnnnnn', where nnnnnnnn is based on the date/time),
    '<Make New Layer>' (it will then open another dialog & ask for a new
    layer-name) and then it lists of all other layers in alphabetical order.
    The Colour choices are all of the default colours in alphabetical order.
    Tip: To scroll beyond bottom of list type the first letter of name and
    then search from there - e.g. W >> 'Wheat', then use arrow keys to
    scroll down to 'White'...

    A dialog asks if you would like the slices equalized - Yes/No - if
    'Yes' - spacing is apportioned into total dimension for even spacing
    of all slices at the spacing or just below, if 'No' then slices are
    spaced as entered and the last slice's spacing is adjusted to fit any
    remaining gap.

    A dialog asks you if you want to number the slices - Yes/No - if
    'Yes' - an incrementing number is added to the slice near its lower-
    left bounding-box corner.

    If you are making more than 25 slices you are warned because this
    might take some time to process.

    It then makes a series of slices through the selection's faces.
    If needed to fill the volume, an unevenly spaced last slice is added.
    Volumes with punched holes will get the slices formed around them but
    only to the 'accuracy' of the slice spacing and the slice thickness.
    The slices are named Slice-n-nnnnnnnn (where n is the slice-number)

    All of the slice-groups are combined into a group called Slice-nnnnnnnn.

    Before ending it checks if 'Xray Mode' was already switched 'on' at
    the start and if so there is no action and it exits. Otherwise the
    original selection is 'Hidden' so you can clearly see the slice-group.
    You are then asked in a dialog if you want to leave it 'Hidden'.
    If 'Yes' then it exits leaving it 'Hidden'. If 'No' the original
    selection is 'Unhidden' and 'Xray Mode' is then switched 'on' so you
    can see the slice-group inside of the original selection and a dialog
    asks if you want to leave 'Xray Mode' switched 'on'. If you answer
    'No' the normal view is restored and it exits (but then the slices will
    be obscured !). If you answer 'Yes' it exits leaving 'Xray Mode'
    switched 'on'.

    You are finally asked if you would like to make a 'flattened' copy.
    Answer 'Yes' to make another group. A dialog asks for the min. gap
    between 'flattened' slices in current units. The flattened-slices
    group is named 'Flat-Slice-nnnnnnn' on layer FLAT-+'Your_Layer_Name'.
    It is placed below the original slice-base with all slices put down
    'flattened' with equal Zs, arranged in order, in as near a 'square'
    pattern (n x n) as possible. Because the non-Z oriented slices have
    to be rotated 'flat' and when rotated they shouldn't overlap, you will
    find that sometimes the spacings between rows(Y) or columns(X) will
    exceed the minimum gap specified. You can always move the flattened
    numbered slices around by editing the flattened-slice group - this
    might then further optimise any real material use etc.

    'Slicer' can't be expected to be 100% foolproof ! It treats an open
    topped object as it if were filled with water, taking slices from the
    outer 'skin' inwards to work out which are the solid and which are the
    hollow volumes. With a little ingenuity you will be able to contrive
    a form with complex linked holes punched in, or a suitable array of
    thin volumes spaced apart so as to miss the sampling slices - which
    because it uses a series of slices, can produce unexpected results.
    Keep forms simple and build them up in bits for safety...

    Date : 12/2005

    Type : Tool

    Verison :
    1.0 18/12/05 First issue.
    1.1 18/12/05 Inches --> inch typo fixed.
    1.2 18/12/05 Circle def moved into class (Mac).
    1.3 19/12/05 X orienatation and last slice glitch fixed.
    1.4 19/12/05 Decimal . AND , trapped...
    1.5 19/12/05 Disc made larger...
    1.6 20/12/05 Pushpull made compatible with earlier version.
    Glitch with groups on -ve axes fixed.
    Option to equalize slice spacings added.
    1.7 20/12/05pm v5+ program only error added.
    1.8 21/12/05 Undo text corrected.
    1.9 22/12/05 Slice numbering option added.
    2.0 24/12/05 Glitches in number locations fixed.
    Slices and their Numbers are now grouped
    individually inside one bigger group.
    Option to make a 'flattened' copy added.
    2.1 16/12/06 'Layer0' removed - Spanish versions etc, now
    makes active_layer the default, whatever it's name -
    & puts text/slices on it before layering groups.
    3.0 09/10/07 Choose / make Layer on fly and select any 'Colour'
    options added. All geometry now on 'default' layer.
    4.0 20100201 Beta - Updated to add possible insets at start and end.
    Added possible 'lines' bisecting vertices onto faces.
    Arguments in () etc...
    4.1 20110206 Temp version to fix complex glitch.
    4.2 20110609 Several fixes; typename>>class, begin/rescue/valid? tests...
    4.3 20110619 Image option added, usage: preselect 'Flat-Slice-nnnnnnnn'
    group and type in Ruby Console: Slicer::images - it makes
    png image files named after each slice, in new folder with
    model named 'ModelName-Slice-Images-nnnnnnnn'.
Please ensure that any earlier versions are removed from the Plugins folder [e.g. named Slicer32.rb] before you place this new version into that folder and restart...
Slicer.rb

THIS TOOL IS SUPERSEDED BY 'SLICER5', AVAILABLE HERE http://forums.sketchucation.com/viewtop ... 69#p374969
1
Last edited by TIG on Mon Oct 08, 2012 1:50 pm, edited 10 times in total.
Reason: Added the plugin to the first post and added the [Plugin] tag
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby matt77 » Fri Dec 21, 2007 7:31 pm

Thank you very much.

I'll keep an eye out for any developments.

Many thanks

Matt
0

matt77 
 

Re: Slicer

Postby TIG » Fri Dec 21, 2007 7:33 pm

Here is v3.0 of Slicer.rb.

You can now choose / make its Layer on the fly and select any 'Colour'...

Enjoy...

(see v. 3.1 here instead)
0
Last edited by Gaieus on Fri Feb 11, 2011 2:00 pm, edited 1 time in total.
Reason: added link to latest version
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby juju » Fri Dec 21, 2007 7:34 pm

I get this error message with Slicer.rb (version 3.0), see image attached.

0
Save the Earth, it's the only planet with chocolate.
User avatar
juju 
Premium Member
Premium Member
 

Re: Slicer

Postby TIG » Fri Dec 21, 2007 7:35 pm

Juju wrote:I get this error message with Slicer.rb (version 3.0), see image attached.

slicer error.JPG


I apologise. I uploaded a version that's customized to my menu setup by mistake ! Of the 40 or so who've viewed it so far you are the only one to point it out... Here's v3.1 that's fixed to suit all.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby seasdes » Fri Dec 21, 2007 7:35 pm

Thank you TIG for another useful script

Walter
0
Using Sketchup Pro 2016

seasdes 
 

Re: Slicer

Postby not registered yet » Fri Dec 21, 2007 7:36 pm

Thanks so much for the new version - works great! I'm using it similarly to the original purpose TIG mentioned, as a cheap 3D printer. Now to create a (cheap) automated way to cut them out!

best,

Matt

[mattratto]
0

not registered yet 
 

Re: Slicer

Postby mariocha » Wed Feb 10, 2010 10:02 am

Very impressive !
And so usefull .
Thanks a million !

The final touch, for the cutting machine (cnc), would be numbers as lines so it can engrave them on the piece.
Oh and also the possibility to add a letter before the number, like A1, A2, .. B1, B2 ...

Great plugin. !
0
Mario C.
Certified SketchUp Trainer, QC CA.
Every rule has exceptions, but some.
User avatar
mariocha 
Premium Member
Premium Member
 

Re: Slicer

Postby TIG » Wed Feb 10, 2010 10:45 am

mariocha wrote:Very impressive !
And so usefull .
Thanks a million !

The final touch, for the cutting machine (cnc), would be numbers as lines so it can engrave them on the piece.
Oh and also the possibility to add a letter before the number, like A1, A2, .. B1, B2 ...

Great plugin. !


I have a [privately written and hopefully paid for] 'Slicer v4' that has such lines added etc for CNC work - watch this space.

Here is a script that will add a prefix for you...
prefixtext.rb

Adds a Prefix to selected text or text inside selected group/instance-definitions
To use - select the objects needing prefixes [text OR groups containing text etc]
then in the Ruby Console type prefixtext + <enter>.
A dialog asks for the Prefix Text - enter it and OK - e.g. A.
All text in the selection is prefixed with the desired prefix e.g. 9 becomes A9 etc...
It is for use after running tools like Slicer
- where sub-sets of slices might be more useful if they are differently coded.
Errors will stop you if there is no selection or you enter a blank 'prefix'.
It is one step un-doable.
:geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby mariocha » Thu Feb 11, 2010 3:00 pm

Thanks for the prefix.rb
Thought I find it difficult to integrate to the process since each text is a group, in a group.
For now, I use component numbers made of lines.

Hum... that v4, is it close to release ?
Need some testing ?

I do think it is worth some money.
0
Mario C.
Certified SketchUp Trainer, QC CA.
Every rule has exceptions, but some.
User avatar
mariocha 
Premium Member
Premium Member
 

Re: Slicer

Postby TIG » Thu Feb 11, 2010 3:49 pm

The prefixtext ruby should 'mine down' into any groups selected and add to all text. It undoes in one step anyway... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby kwalkerman » Thu Feb 11, 2010 7:43 pm

Hi,

I'm interested in using the slicer plugin. I'm using the trial version of Sketchup Pro 7.1, and have downloaded Slicer31.rb. Whenever I try to use the plugin, Sketchup crashes. Any help is appreciated.

Thanks!

Karen
0

kwalkerman 
 

Re: Slicer

Postby xrok1 » Thu Feb 11, 2010 8:05 pm

I have a [privately written and hopefully paid for] 'Slicer v4' that has such lines added etc for CNC work - watch this space.


hey, are you finally going to make your own and bust that slicemodeler @&&hole :berserk:
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

Re: Slicer

Postby TIG » Thu Feb 11, 2010 10:45 pm

kwalkerman wrote:Hi,
I'm interested in using the slicer plugin. I'm using the trial version of Sketchup Pro 7.1, and have downloaded Slicer31.rb. Whenever I try to use the plugin, Sketchup crashes. Any help is appreciated.
Thanks!
Karen

First try testing it on a simple group and make a modest number of slices - say 10...
When you get the hang of what it does you can then up the 'fineness' of the slicing... BUT be patient...
If you try to make hundreds of slices it will take a while and it sometimes 'whites-out' and appears to stall... BUT it will usually complete if you leave it for a while...

:geek:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby TIG » Thu Feb 11, 2010 10:46 pm

xrok1 wrote:
I have a [privately written and hopefully paid for] 'Slicer v4' that has such lines added etc for CNC work - watch this space.

hey, are you finally going to make your own and bust that slicemodeler @&&hole :berserk:

I have written a paid commercial version [private] - Slicer_v4 - for someone for CNC use etc... it [or some of its ideas] might leak out to you too... ;)
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby xrok1 » Thu Feb 11, 2010 11:05 pm

awsome! :enlight:
0
“There are three classes of people: those who see. Those who see when they are shown. Those who do not see.”

http://www.Twilightrender.com try it!

xrok1 
 

Re: Slicer

Postby kwalkerman » Fri Feb 12, 2010 3:52 pm

Thanks for the response. I have tried the slicer on a simple block, and only requested a few slices, but sketckup crashes completely and closes after it asks whether to add numbers to the slices. Anyone else have this issue?

Thanks.
0

kwalkerman 
 

Re: Slicer

Postby TIG » Fri Feb 12, 2010 4:19 pm

A mystery...
Your details please:
Platform & OS
SUp version
Version of Slicer [open file with Notepad and read first section...]
Other plugins loaded [only anything unusual?]
Can you upload a simple skp that you have the problem with and a description of what failed - e.g. Z axis, 12" c/c etc...

It usually works painlessly for most users... :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby mariocha » Fri Feb 12, 2010 6:01 pm

TIG wrote:
xrok1 wrote:
Slicer_v4 - ... it [or some of its ideas] might leak out to you too... ;)

So as to plan my work, is there a time estimate ?
0
Mario C.
Certified SketchUp Trainer, QC CA.
Every rule has exceptions, but some.
User avatar
mariocha 
Premium Member
Premium Member
 

Re: Slicer

Postby eco_artbarn » Sun Feb 14, 2010 11:59 pm

hey I have been looking for this for ages to help my pupils with our laser cutter but i have been trying to down load slicer 3.1rb but i cant work out where to put the text version.
is there a slicer 3.1.rb file that i can just save and load into plugins folder?

cheers
0

eco_artbarn 
 

Re: Slicer

Postby TIG » Mon Feb 15, 2010 12:19 am

viewtopic.php?p=16697#p16697
Save the linked file as Slicer31.rb into the Plugins folder - done...
If your browser insists on making it another file type you can always use Select All on the page and paste it into a new empty plain text file and rename it with a .rb suffix NOT .txt ...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby mariocha » Mon Feb 15, 2010 4:01 am

In our work, we often deal with terrains modeled as surfaces, not volumes, often very irregular. Making a volume out of them is sometimes quite hard, even with Joint Push-Pull.
Is there a "slicer" that can make slices from a surface ? Slices would then be only segments. :)
0
Mario C.
Certified SketchUp Trainer, QC CA.
Every rule has exceptions, but some.
User avatar
mariocha 
Premium Member
Premium Member
 

Re: Slicer

Postby TIG » Mon Feb 15, 2010 10:03 am

To give a meshed surface a volume requires a bit of planning...
You select all of the perimeter edges.
Then use my tool ExtrudeEdgesByVector to extrude all of these edges vertically downwards (-ve Z / blue) far neyond the lowest one.
Check that the faces are 'outwards'.
Leave the extrusion in its group for now.
Edit the group and draw a large flat rectangular plane facing down [reverse if necessay] located below the geometry, but so that it intersects with ALL of these new vertical faces.
Select All inside the group and 'Intersect with Selected'.
Erase the unwanted bits of the rectangle and change your view so you can easily 'select by fence' the bits of the vertical faces below it - delete them.
Close the group-edit and select all of the mesh and Edit-Copy.
Edit the group again and Edit>PasteInPlace
Now you have a 3D volume with the top as a mesh...
Move it to one side or copy the group and paste it into an empty model - and you can Volume or Slice, or whatever you need to do...

If you have two meshes - e.g. existing and proposed land surfaces - you can do a 'cut and fill' volume etc by intersecting them together and making a groups of what's left - there's a tutorial on that somewhere...

:enlight:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby eco_artbarn » Mon Feb 15, 2010 4:36 pm

Thanks TIG that works a treat.
i am sure i have seen a slicer tutorial before where it adds the slots half way up and half way down, is there a way of doing that with 3.1?

i slice in the x and then sllice in the y and lay the sections out flat, but if there was a way of adding the midway slots that would be a huge advantage

let me know cheers ash
0

eco_artbarn 
 

Re: Slicer

Postby TIG » Mon Feb 15, 2010 5:33 pm

There is a paid script SliceModeller that I unwittingly helped develop !
That adds slots to the slices... Slicerv4 might do that too... ;)
0
Last edited by TIG on Thu Feb 18, 2010 11:15 am, edited 1 time in total.
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby eco_artbarn » Mon Feb 15, 2010 6:16 pm

cool, when's it gonna be ready to unleash on us? :berserk:
0

eco_artbarn 
 

Re: Slicer

Postby mariocha » Thu Feb 18, 2010 5:03 am

Tig, I have tried your method to give a volume to a mesh surface. Not bad. But not it, for us.
Having to do all these extrusion just kills the gain. (btw I used the term terrain where I should have used cliff and hill sides.)
What we need is to replace our manual process of generating slice from the meshes, group&number them, and offset to get rib (& face) for cnc.
Or maybe just a rb to make numbered groups of our slice lines and then flattened copies ? :)
0
Mario C.
Certified SketchUp Trainer, QC CA.
Every rule has exceptions, but some.
User avatar
mariocha 
Premium Member
Premium Member
 

Re: Slicer

Postby TIG » Thu Feb 18, 2010 11:14 am

mariocha - I don't fully follow you...
To work out Volumes there are Volume Tools - Slicer is a different thing ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: Slicer

Postby mariocha » Thu Feb 18, 2010 12:47 pm

Sorry, I meant
Slicer only works on volumes, so you suggested to make volumes out of our meshes (with ExtrudeEdgesBy Vector).
We would like to automate mesh slicing to rib. :)
(giving an offset value to make the face)
0
Mario C.
Certified SketchUp Trainer, QC CA.
Every rule has exceptions, but some.
User avatar
mariocha 
Premium Member
Premium Member
 

Re: Slicer

Postby TIG » Thu Feb 18, 2010 1:57 pm

Wouldn't it be quicker to make the 'curtain' and then use JointPushPull on it to give it a Volume then Slice it ?
Or are you looking for a Slice at Nodes option ?
Can you give a before and after example, with steps so I can understand your issues better... :?
0
TIG
User avatar
TIG 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Next


 

Return to Plugins

Who is online

Users browsing this forum: roltsi89 and 14 guests

Visit our sponsors: