algorithmic modeling for Rhino
Well... it failed.
I have a list of paths that I split before the file extension. Now I want to get a list with only item "0" which is the path without the extension.
My mask gives me exactly what I don't want : the extension alone.
Later, I figured how I could do what I wanted with "Flip" plus "Branch", but that leaves me just as ignorant about path mapping and why my attempt failed.
Tags:
Hi Olivier,
are you trying to get this done, or are you trying to learn how to use the Path Mapper?
If (A), then just use the List Item component with the index set to 0. Or use the Cull Index component with index set to 1. Or replace the text ".csv" with an empty text before splitting the file paths.
If (B), then this is a weird problem for the path mapper to do. The mapper was designed to transform a tree from one topology into another, without removing any of the items. It is possible to 'lose' items in a path mapper, chiefly because it's possible to overwrite items, which is what's happening in your case. Let's walk through it. Here's what the mapper does, step by step.
I recreated your problem with easier data, so we can be clear exactly which item we're talking about:
So every extension overwrites its respective citrus, because they are both stored at index=0.
In short, the Path Mapper is not the tool to use to select specific items from a tree, it's only good at transforming entire trees.
Incidentally the [Split Tree] component which uses a notation somewhat similar* to the Path Mapper does do what you're after. It's purpose is to take a tree and split it into two separate, but topologically identical trees, where each item in the original tree only occurs in one of the outputs. Namely, if the item is described by any of the splitting masks, it'll end up in the P (for positive) output, if none of the splitting masks describe the item location, it'll end up in the N (for negative) output:
Oh thanks ! Now I know "Split Tree" !
I would love to see little screen captures like this in the "Grasshopper Help" boxes.
If I look into the present Help for "Split tree", it will mention "Splitting Masks" , and up to now, in my mind, it would only bring this up.
:)
Yeah we're working on a better help system for GH2, with proper explanations and example files for all components. But ---like GH2 itself--- it's a long term project.
List item... of course !
Duh... I use this all the time ; why did I start messing with the Path Mapper ?
I guess read the "Help" text for Path Mapper and found : "Take the original path but ignore the last index" ; and it sounded close to what I was trying to do.
Now I'm trying to flip all the matrixes in these .csv files , but all at once , since I could have dozens of them.
I understand that "Flip Matrix" can't handle this because he wouldn't know what branches to flip.
Would the Path Mapper help me here ?
Is there a "Path Mapper for dummies" book that I could read ?
The primer / Third edition is a bit abrupt on the subject.
I found a "PathMapper_20110315.png" image but it just stacks examples and somehow doesn't give me the key.
Cheers,
YES, the path mapper may be of help here.
There's no consolidated tutorial anywhere as far as I'm aware, just a bunch of people who wrote some stuff about it. However by and large the path mapper is conceptually easy to understand, the difficultly is in coming up with the exact mapping you're after, which is more a datatree problem than a mapper problem.
The bit on the left (or the "source pattern") must match the datatree you have. If your tree consists of {0}, {1}, {2}, etc. then the pattern must look like {A}, or optionally {A}(i) if you also with to take the item index into account. That's the easy part, and you can use the 'Create Null Mapping' menu option to generate correct source patterns.
The bit on the right (or the "target pattern") is what you want the tree to look like. In your case you wish for the last path element and the indices to be switched. So a tree that looks like {A;B;C}(i) instead becomes {A;B;i}(C). See, you're 'flipping' two parts of the location of each item within the tree.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by