Code Monkey home page Code Monkey logo

refinerytoolkits's Introduction

Refinery Toolkits

A collection of packages to accelerate generative design workflows in Dynamo & Generative Design (formerly "Refinery").

Space Planning Toolkit floorplan layout

The toolkits

There are currently 2 packages included in the toolkit, each focusing on enabling specific types of workflows:

  • SpacePlanning Toolkit
  • Massing Toolkit

Space Planning Toolkit

The toolkit offers a range of nodes that help with general space-planning workflows in Dynamo and Revit.
Space Planning Toolkit package nodes

Read more about the SpacePlanningToolkit

Massing Toolkit

Optimization & design option generation. Massing Toolkit package nodes

Read more about the MassingToolkit

Read more about the MassingToolkit for Revit

Using the toolkits

This repository has quite a few sample files provided to help you get started with each of the toolkits. It is highly recommended to start with the samples as they contain detailed notes and instructions on how to use each of the nodes. Feel free to open an issue or submit a PR if you'd like to see further documentation added here.

You can find the samples in this repository's samples folder folder, as well as and in the extra folder of the package you download using the Dynamo Package Manager, typically found here : %appdata%\Dynamo\Dynamo Revit\2\packages\GenerativeToolkit

The samples shows a simple example of how each node in the toolkit works. Some of the samples will have a Revit version (marked with (RVT)), and some also have a version setup to be used with Generative Design (marked with (RefineryVersion)) :

Structure

The RefineryToolkits is organized in 4 categories, based on their use in a Generative Design process :

  • Generate: In this category you can find nodes to help generate design options.
  • Analyse: The designs generated in the previous step can now be measured, or analyzed on how well they achieve goals defined by the designer. This category contains nodes to help with that.
  • Rank: Based on the results of the analysis, design options can be ordered or ranked. This category has nodes for that.
  • Explore: In Explore, nodes that helps visualize result are placed.

Alternative installation methods

Manual install

If you prefer to install one of the more experimental/work-in-progress builds, you can still follow the instructions below.

  • Download the latest release from the Releases page
  • Unzip the downloaded file, we recommend using 7zip.
  • Once unzipped, double-check that all .dll files in the package's bin folder have been unblocked.
  • Copy the package folder to the location of your Dynamo packages:
    • %appdata%\Dynamo\Dynamo Core\3.0\packages for Dynamo Sandbox, replacing 3.0 with your version of Dynamo
    • %appdata%\Dynamo\Dynamo Revit\3.0\packages for Dynamo for Revit, replacing 3.0 with your version of Dynamo
  • Start Dynamo, the package should now be listed in the library and in Dynamo's Package Manager.

Prerequisites

This project requires the following applications or libraries be installed :

Dynamo : version 3.0 or later
.NET : version 8.0 or later

Please note that only projects with Revit (e.g. MassingRevit) in their name have a dependency on Revit and its APIs. The others will happily run in supported versions of Dynamo Sandbox.

Contributing & code of conduct

Contributor Covenant

Please read CONTRIBUTING.md for details on how to contribute to this package.

Also note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Licensing

This project is licensed under the Apache 2.0 License - see the LICENSE FILE for details.

Packages used

This project uses the third-party packages listed below, whose licenses are available in the docs folder as per their MIT license requirements.

We do our best comply with all license conditions and restrictions, so please let us know if you have any questions or spot anything out of order.

refinerytoolkits's People

Contributors

archinate avatar johnpierson avatar mrahmaniasl avatar radumg avatar saintentropy avatar shknudsen avatar twastvedt avatar varvaratou-adsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

refinerytoolkits's Issues

Inputs seen from Point

Giving a point, which of the inputs can you see.

@radumg might need some pointers on how to implement this.

IN[0] - Point, to analyse.
IN[1] - Objects to check if visible from IN[0].
OUT - visible objects from IN[1] (Might be a dictionary {Visble objects, Not visible objects})

  1. How do we handle the fact that IN[1] can be different types? (ie. you want to check visible spaces from a desk, IN[0] - Desk Location IN[1] - Spaces as polygons.
    Or you want to check which surrounding buildings can you see from a new building, IN[0] - New Building mass IN[1] - Surrounding Buildings masses)

  2. Should we make helper functions like, generate space polygons from rooms or do we leave that to be a user option so users define how the inputs for IN[1] should be. And if so how do we handle that this can be of different types.

glitch on Isovist

comment from PR #37

Also, it seems to be a glitch on the Isovist, getting inside the internal polygons. I know that is an error somewhere on the Graphical code but will need to be assessed.
(link)

update node description for VisiblePoints.FromOrigin

Add to the description what the node returns eg. returns a number from 0-1 where 0 indicates no points are visible and 1 indicates all points are visible.

this could also be changed to be 0-100 and the description says a 'returns a percentage number between 0-100 that indicates how many points can be seen'

Shortest Path

Shortest Path Node

  • Implement Graphical in the GenerativeToolkit.Graphs project (Talk to Alvaro about removing all code not necessary).

  • Quickest path & Sensible Path

split up or document long methods

When dealing with long methods (>30 lines of code), we should either

  • split up functionality into private util methods in that class, based on the distinct steps in the method
  • add // comments to document the distinct steps required, in plain English (the WHY, not just the WHAT code is doing).

Tasks

  • identify long methods & create task here for each
  • refactor them

Openess.FromPoint

I think this is confusing. We are driving the value from the point but the point really has no relationship to anything as you have to build the object width and length. Maybe this should be Openess.FromSurface and we remove the reference to the point. I also think we should remove the hardcoded values of 0, 0.25, 0.5 etc and instead use a percentage of the perimeter. So find the perimeter of the surface and calculate how much is open. Include a tolerance, so it takes into account objects that are a given distance away too, not just the ones that are coincidental. This should mean it can work on irregular shapes not just rectangles.

Node default values

Set up default values where possible so the nodes can run without the need to add every input. As an example ViewsToOutside.ByLineSegments has 4 inputs - boundary, internals, view segments and origin. Internals should have a default empty list so the node can run with no internal obstructions. I'm thinking of L-Shaped or other irregular floor plates where by internal boundaries dont come into play but you want to understand the view from a point partly round a corner.

Openess

Check openess of desk. give "Openess" score based on how many sides of desk is against a wall.

Score from 0-1. E.g -> if desk against two walls, score = 0.5, if desk against 3 walls score = 0.75.....

Adjacency

Adjacency nodes with points

  • List of points, find common point (2D/3D)

markdt [8:51 AM]
Another one for the finding closest point to a set of points.
You could add in a surface to this and the point cannot sit in that space
Sylvester Knudsen [8:55 AM]
So one of the inputs would be something like "areasToAvoid"?
markdt [9:33 AM]
Yes exactly
Dunno if any of this is possible
But they would have some epic use cases

  • List of points and surface/polygon - find the farthest point.

Isovist Node

Expose Isovist method from Graphical as Node in GenerativeToolkit

code formatting & org according to Dynamo standards

Dynamo standard here : https://github.com/DynamoDS/Dynamo/wiki/Coding-Standards
(background : based off the Microsoft standards that we adopted at @designtechIO anyway)

We need to cover

  • formatting
  • namespaces
  • documentation
  • testing

Formatting

  • format if statements as per standard, for example this one doesn't need { }

  • remove un-needed code regions (see here for example and here. As a guide, only do a #region when it encompasses multiple methods, so in the last example, we can do a Constructors but don't need a distinction between public & private since they're one each.

  • not have multiple public classes in one file : either spin them into a separate file and make internal or if not used elsewhere make them private

  • remove dead/commented out code ([example] (https://github.com/designtechIO/GenerativeToolkit/blob/eda36ca1abe58024491b092e7a53ab9c2b0aa935/GenerativeToolkit/Analyse/AdjacencyPreference.cs#L85)) (use VS2019)

  • determine if methods that are not used are still needed (for example OpenessScore)

  • lift up magic values to private constants if applicable only in that class (example and in a public static class Constants if used across multiple namespaces. (use VS2019)

  • throw when a method cannot return a valid response, for example when return is conditional on something (example) we throw instead of continuing and returning something potentially invalid/malformed

  • rename output constants to something recognisable (here for example, rename to pathOutputName & lengthOutputName )

  • use var instead of type where type can be inferred from right-hand side of expression/statement (example) (use VS2019)

  • methods with 2 or more parameters should have them on separate lines for legibility, for example (use VS2019)

  • make sure multi-return nodes/methods use private constants to specify output name (see here)

  • clean up redundant namespace qualification for types where possible, for example Autodesk.DesignScript.Geometry is not needed since we added the using already. If we hadn't, nice fix would be to add it.

Namespaces

  • rename Analyse to Analyze as we agreed to use US English (๐Ÿ˜ž), both namespace and folder

  • remove Evaluate folder & namespace as it's not in Generative Primer stages

Documentation

  • add XML descriptions to classes
  • convert // comments into XML comments even when classes/methods are private

Testing

refactor Utilities

we need to

  • convert Utilities.List class to host extension methods (rename to ListExtensions, make static, add this to the method's list parameter).

Anything else matching this pattern should also be an extension

bail early in methods to minimise cyclomatic complexity

Many methods can leverage the bail early principle to

  • ensure a valid context & input before going further
  • reduce the depth of code nesting and complexity of if/else branching.

For example, what happens when this method is given 2 points or 5 ? The first thing we should do is check the list of valid length (3 or 4 here) and if not bail
https://github.com/designtechIO/GenerativeToolkit/blob/eda36ca1abe58024491b092e7a53ab9c2b0aa935/GenerativeToolkit/Analyse/AdjacencyPreference.cs#L20-L30

In this context, bail means throw new Exception, using the appropriate type of Exception and having human-legible messages.

Isovist.FromPoint example

Change the example origin point so it is a uv value on the input surface. This will ensure the graph cant fail by the point falling outside the boundary

Views to outside

  • Giving a point how many views do you have to the outside
  • Giving a point how much view do you have to the outside (how do we measure the amount of view?)

IN[0] - Point
IN[1] - Outside (should this be an area, if so how should it be represented?)
OUT - ???

@radumg @MarkThorley

should we expose colours from palette for individual use

Need to confirm with ADSK @saintentropy if we'd like to expose all 19 standard colours as individual nodes.

Right now, it's not hard for users to get to them by using the ContrastyColorRange node and then a GetItemAtIndex node to get a specific colour. Would adding 19 nodes add any value ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.