Skip to content

Components

Dan Cascaval edited this page May 4, 2024 · 2 revisions

Impala

Components

QuickMath Components

Impala's math components avoid Grasshopper's type checking and dynamic casting logic and specialize to double-precision numbers and vectors.

This offers on average 22x speedup for randomly generated trees, 16x speedup for flat lists, and comparable performance for grafted lists with length ranging up to 200k. For workload that contain many short 1 or 2 item lists, it is recommended to flatten and unflatten when piping into QuickMath components - the cost of doing this is often made up many times over by the speed gains the components provide.

  • Binary Arithmetic
    • QuickAdd
    • QuickSubtract
    • QuickMultiply
    • QuickDivide
    • QuickModulus
  • Binary Comparison
    • QuickEquals
    • QuickAlmostEquals
    • QuickLessThan
    • QuickGreaterThan
  • Unary Arithmetic
    • QuickAbsoluteValue
    • QuickNegative
    • QuickAverage
    • QuickBounds
  • Vector Arithmetic
    • VectorAdd
    • VectorSubtract
    • VectorBounds
    • VectorAverage

Inclusion components

These components test point containment within closed multi-dimensional geometry such as curves and meshes. In the case of curves, an input plane is required - both the curve and the point will be projected to the plane for the inclusion test. It is recommended to extract the discontinuities or perform a curve division and fit a plane to these points to project any non-planar input curves. Additional support is provided for inclusion within a set of curves or meshes.

  • Points in Curves
    • ParPointInCurve
    • ParPointInCurves
  • Points in Meshes
    • ParMeshInclusion
    • ParMMeshInclusion

Physical components

Impala provides tests for physical geometric relationships (distance in Euclidean space) between points, and the nearest point on a piece of geometry. These are parallelized/aggregated versions of existing Grasshopper functionality. They expose a threshold beyond which points will not be projected - this is particularly useful when attempting to cull out all points within a radius, as the result of the projection can be used as a cull pattern directly, with much faster results. These achieve approximately linear speedups in most cases, though implementation differences may result in greater improvements for some workloads.

  • Curve Closest Point (ParCurveCP)
  • Closest Curve Closest Point (ParCCP)
    • Finds the closest point on the closest curve in a list of curves.
  • Point Closest Point (ParPointCP)
    • Finds the closest K points in a list of points.
  • Mesh Closest Point (ParMeshCP)

Intersection components

Intersection components test for geometric intersections between geometry. They are direct implementations of their Grasshopper counterparts. These usually achieve close to linear speedup on most input sizes.

  • Mesh | Curve Intersect (ParMCX)
  • Curve | Curve Intersect (ParCCX)
  • Mesh | Ray Intersect (ParMRay)

Extension components

Extension components provide additional composition, chunking out large parallel operations and reducing the time spent copying or casting values around. As a result they achieve super-linear speedups.

  • Mesh Flow (ParMeshFlow)
    • Flows down points along a mesh according to a gravity vector. This is useful for simulating particles, forces, etc.
  • Visual Center (ParVisCen)
    • Finds the weighted center of a closed curve. This provides an approximation of 'Center of Gravity', and can be very useful for things that require labels to be associated with irregularly shaped geometry.
  • IsoVist Components
    • IsoVist2D
      • Casts a 2D arc of sample points along a plane and a sampling domain.
    • IsoVist3D
      • Casts an evenly-spaced 3D sphere of points around it, outputting a mesh which can be analyzed for view areas or decomposed.

Benchmarking components

Benchmarking components are important for tuning and testing different implementations when making reusable processing scripts.

  • Stopwatch
    • Measures the aggregate runtime of all of all input components.
  • GroupStopwatch
    • Measures the aggregate runtime of all components within the same group that are upstream from its input.