Showing posts with label rhino. Show all posts
Showing posts with label rhino. Show all posts

Tuesday, September 29, 2020

Troubleshooting Large Files - Audit3dmFiles

I know why my files are too large. It's often due to sloppy modeling, inheriting old pieces, and heavy detail meshes. We are trying our best but sometimes things grow out of control. So what now?

Audit3dmFiles is a rhino command that provides, among other things, a readout of each file size. Below I've created a spreadsheet template to help sort them by file size. Then I go ahead and simplify/delete them individually (SelID). 

1. Audit3dmFiles: Select File. Note that the file grew 7x.


2. Copy readout to Excel. Readout includes file, plugins, material, layer, group, block, and object metadata


3. Extract just the object data into a new worksheet. Use the following formulas to isolate object size and object ID:

    B1: =LEFT(A1,FIND("bytes",A1)-1)

    C1: =INT(RIGHT(B1, LEN(B1) - FIND(":",B1)))

    D1: =LEFT(A1,FIND(", name",A1)-1)

    E1: =RIGHT(D1, LEN(D1) - FIND("=",D1))


Headers were put in for clarity. 


4. Copy all the formulas down, sort by column C, and select Expand Selection. 

5. Copy each column D item. Once inside Rhino, run SelID and paste the ID and zoom to the offending object. Rebuild/ Delete/ Save and watch your file size come back down.

6. Turns out a few minor elements were creating havoc. Reduced the file all the way down to 64MB.

Maybe in the future, I'll create a script to audit and highlight the top 10 items.

Monday, August 24, 2015

Multiple Hi Res Screen Shots

Update: Script now takes layer states into consideration when taking screen shots. For example, if the model has 2 named views and 5 options saved as layer states, this script will pull a total of 10 screenies.

Rhino has a command called ViewCapturetoFile that allows for screen captures. Better yet, the dashed version of the command ("-ViewCapturetoFile") allows for custom resolution captures. I was able to extract 16000 x 16000 pixel image files (haven't tested higher)!

Still, it is annoying to individually captures your saved views, so I've created a script back in 2011 (recently updated):


This is a simple script that runs through ALL of your named views at your chosen dimensions, and saves them to a folder of your choosing. 


Saturday, July 18, 2015

FaceMe for Rhino

I don't know why but Rhino still doesn't have a feature similar to sketchup's FaceMe. By using only a billboard image instead of a heavy 3d model, FaceMe is one reason why sketchup scenes can be so light weight. Years ago I made a rhinoscript to accomodate this, but recently I adapted it to grasshopper so that it can be more controllable.






Simply stated, this is a grasshopper script that reorients the billboards to face an attractor point. I've also attached some jitter commands to create some variation. Then bake the new billboards and delete the initial surfaces. In the future, some vb/c# work can link the attractor to the camera location. 

Note that for now, all billboards textures must be assigned by layer and differently billboard images need to be grouped and baked separately.


Typical billboards


FaceMe




Move Jitter


Rotate All Billboards


Rotate Jitter




Combined Effects



Friday, July 3, 2015

Exaggerated Ribs


CurvatureGraph provides a nice analytical tool to review curves for kinks. It is also a pretty way to "grow" the curve. I wanted to build off of Jittery Lines with a script that thickens polylines relative to its control points, as CurvatureGraph works for a Curve. It's a common effect (that I'm almost certain there's an existing script for) that I want to explore and build on top of.

To go about this, I've broken the script down into 5 parts:

1. Explode polyline to get line segment vectors
2. Calculate bisecting vectors*
3. Calculate angle and direction of "turn" from original vectors
4. Create offset vectors at the kink points
4a. Create Weighted Offsets based on adjacent vector angles
5. Join these points into new polylines


*Just using bisectors for the offsets will result in "twisted" ribbons. That is why I untwist this by "flipping" the bisector when the line segment goes from clockwise to counterclockwise.




Here's a 2D example running on multiple curves:



I've resolved part 4a by creating three options for weighting how I offset the polylines: by a shift slider (shift about center), an equal slider (grows equally), and by duo sliders.



More forms:



Tuesday, September 11, 2012

City Collection

From time to time I wander through Google Earth, mesmerized by the intricacies of these 3d models (though they are shallow approximations). As a record I've started to gather a few parcels here and there of our cities, for myself and others who want to play around:



Berlin

Barcelona, Spain

Colosseum, Rome

Central Park, NYC  Link updated 131019

rhino5 capture with glxtractor


Paris

Prague

Shanghai Bund, China

Vatican See, Rome

Venice, Italy



Tuesday, November 22, 2011

Smart Select Pt.2: Set Current Layer

I've been using this script since early this year. It started from our frustration at: "Which layer does this object belong to?" and "Why must I always look at the properties tab?". I wrote the script to help find and quickly do some layer management/ file cleanup:

DefaultLayer.rvb: alias "d" - used for steps 5 and 6

So pick your object, run the script, and choose the following:
1. Set current layer to the object's layer*
2. Select all objects on that layer
3. Hide all objects on that layer
4. Isolate all objects on that layer
5. Turn that layer off
6. Lock that layer
7. Do nothing, other than peek at which layer that object belonged to*.

*change the "Current Layer Background" to a bright color to really see that layer pop. Find it at Options --> RhinoOptions > Appearance > Colors > LayerDialogBox.

Rhino has most of these commands (SetLayertoObject, OneLayerOn, OneLayerOff, SelLayer), but typing/ clicking through them is way too much work.

photos coming soon...

Smart Select Pt.1: Select Similar Object

I'm working on a smarter selection tool for rhino, so I'm starting with the basics.

This script selects:
similar closed polysurfaces by volume and at least one other dimension...
similar open surfaces/ polysurfaces by surface area...
similar open or closed curves by length, control points...

So click any of those objects, and watch as the script picks up similar objects in your file!

SelSimilarObjects.rvb (remember to convert the .txt into .rvb)

Wednesday, October 12, 2011

Spatial Deform: Grasshopper Introduction

Rhino's CageEdit command's closest equivalent in grasshopper is Spatial Deform. The combination of an already powerful command with grasshopper's interactive nature makes this a very complicated and memory intensive tool to figure out and use. Other than this Q&A and this demo, I really can't find a good example of using Spatial Deform, so here goes a basic introduction:


To use Spatial Deform, you'll need to attach the following:
'G' - the rhino geometry to deform
'S' - a series of points that will define the cage
'F' - the forces applied to each of the points in 'S'
'f' - a falloff equation

Now this script takes advantage of Kangaroo's removeDuplicatePts. If you don't already have it, get it at their website.

Sunday, October 9, 2011

Match Cage Edit + FlowAlongSrf



Part 2 of the MatchCageEdit series shows how I can combine the script with rhino's FlowAlongSrf as a rough and quick paneling design tool. In many regards it is similar to a grasshopper CageEdit, but allows for easier manipulation.


Match Cage Edit


MatchCageEdit.rvb

This is Part 1 of a three part exploration into Rhino's CageEdit and Cage commands.

In Rhino, I frequently use cage editing for sloppy massing control. However, it has the ability to become a powerful and accurate design tool if there was a bit more workflow control. Imagine if you were working on developing a two-piece composition with cage editing, and then you've decided that it really needed three pieces. How would you add another object to cage? What you would need to do is to start over with a new cage and slowly deforming the control points until it looks like the previous control/cage. Ugh!

The actual steps to rebuild a deformed cage is simple but tedious. That's why here is a script in the same vein as MatchProperties or MatchLayer:

MatchCageEdit.rvb (change .txt to .rvb)


Friday, September 30, 2011

Making Slabs with Grasshopper

Slab is a limited command in rhino, but it has its uses in quickly putting up simple extrusions. It's always annoying to change your workflow because a basic tool is missing in grasshopper, so:


The definition is really simple. A series of closed, planar curves, the offset (inwards or outwards), and the extrusion value. With those in place, the script does a few offsets and booleans, and then spits out the slabs.


Sunday, September 25, 2011

Label by Layer

Sometimes, while diagramming in rhino, it helps to easily see to which layer each object belongs. This script simply adds a text dot of 'layer name' at the center of each object, and then groups it with the object.

LabelByLayer.rvb - (change .txt to .rvb)

Rhino Hidden Line



A few of us at work had been complaining that Rhino did not have an easy to use hidden line feature. But there is, if you know how to set it up. It involves creating a "new display option" (AdvancedDisplay). 

I've written this .rvb script (for rhino4 or rhino5wip) that will allow you to easily toggle in and out of a hiddenline mode. 
 
SetHiddenLineMode.rvb - (change .txt to .rvb)
Hidden Line.ini - setup file with colors
Hidden Line White.ini - setup files with just white lines


Friday, July 9, 2010

Smart Cplanes from Objects

This is another one of those free-yourself-from-repetitive-tasks scripts.


Customizable Cplanes allow for complex forms and creations in Rhino. Imagine a series of gateways arrayed along a serpentine perimeter. While the concept may be parametric, the process for each gate is often individual and incremental. By giving up grasshopper, I am forced to painstakingly create a Cplane for each gateway alternate between them via NamedCplanes. There's got to be a better way!

Actually, rhino has the ability to create a cplane from a single crv/srf. But what about an object? a bunch of objects? or just about anything?

Well, here is the script. Just save it as an .rvb file, and create an alias/macro for it. (macro <_Cplane _world _top> will reset the cplane)

Saturday, July 3, 2010

Extracting 3d models from Google Earth


*updated October 2013.

The following tutorial does not seem to work for everyone, so
Try requesting a 3d capture here.


Friday, April 30, 2010

Lasso Objects for rhino

Rhino has many selection options. For the adventurous/ graphically minded, there is the lasso tool that emulates the photoshop lasso selection. Alas, it only works on points in rhino. Thus, I have expanded on it to provide selection for all types of objects.


1. hide as much as you can

2. run script, it will create points for you to lasso

3. lasso them as you would in photoshop

Sunday, April 25, 2010

Columns from Srf and Grid



To create a field of columns of different shapes in rhino, you will need the following ingredients:
- a couple of intersecting lines
- a ceiling surface
- a simple grasshopper script
- and a bit a patience and curiosity

Directions:

1. draw your curves
2. draw your surface
3. select the curves and srf in the grasshopper script
4. adjust curve/srf as you see fit

grasshopper script requests 4 variables: the intersecting curves (column starting points), surface (height), width, and length.

Sunday, February 7, 2010

Converting Meshes to Surfs in Rhino

I ran into a problem this afternoon of importing a Revit model into Rhino via dwg format. What used to be flat surfaces have now become messy meshes, making the import impossible to work with. Having ran into this problem before with Sketchup, Ive decided to figure out a way.

The solution is rather straightforward:
1. use "MeshToNurb" on a Mesh to get a polysurface.
2. use "Silhouette" on the pSurf to get a bunch of outlines.
3. use "PlanarSrf" on the outlines to get the final Surface.
4. delete the intermediary steps
repeat.

original mesh model
meshes converted into surfaces

Since I had over 400 surfaces, I decided to just do some rhinoscripting. The script does just the above, without altering the original meshes. After processing the selected meshes, the script ends with all the new objects highlighted, in case you wanted to drop them into a new layer/take out isocurves. Just change .txt to .rvb and load it to rhino.