Pulga Obstacle Force#
Functionality#
This node creates a force to be applied with the Pulga Physics Solver node.
Obstacles (meshes) that will collide with the system particles (vertices)
Input#
Vertices: Vertices of the obstacles.
Polygons: Polygons of the obstacles.
Generator-> Box
Viz-> Viewer Draw
Absorption: Amount of energy that will be absorbed by the obstacle (reducing speed and acceleration). 0 means no absorption and 1 full absorption
Number-> Number Range
Vector-> Vector In
Pulga Physics-> Pulga Physics Solver
Examples#
Grid of vertices colliding with a soft Cylindrical mesh:
Generator-> Plane
Generator-> Cylinder
Matrix-> Matrix In
Viz-> Viewer Draw
Pulga Physics-> Pulga Physics Solver
Grid of vertices colliding with a soft spherical mesh:
Generator-> Plane
Generator-> Sphere
Matrix-> Matrix In
Viz-> Viewer Draw
Pulga Physics-> Pulga Physics Solver
Trajectories of vertices colliding with a hard spherical mesh.
Generator-> Line
Generator-> Plane
Generator-> Sphere
Modifiers->Modifier Change-> Mesh Join
Transform-> Move
Number-> Number Range
Matrix-> Matrix In
List->List Main-> List Join
Viz-> Viewer Draw
Pulga Physics-> Pulga Physics Solver
Obstacle geometry domains#
The Domain selector provides Vertices, Edges, and Polygons.
The default Polygons mode keeps the existing BVH-based response intact,
including the original Vertices, Pols and Absorption inputs.
Vertices: stationary point obstacles, using the supplied vertex positions. Auto uses a cached SciPy
cKDTreewhen available; NumPy and Numba use their explicitly selected closest-point kernels.Edges: stationary line segments defined by
VerticesandEdgesindex pairs. Each particle is corrected toward the closest point on the nearest segment. Auto uses a Numba kernel when available.Polygons: the existing polygonal BVH obstacles, unchanged.
Thickness, visible for point and edge obstacles, adds to the solver’s
particle radius; unlike the source polygon response, point/edge obstacles do
not require a surface normal. Absorption retains its existing meaning.
When a new point/edge contact is approached, velocity is reflected and damped;
forces are likewise reflected when directed into the obstacle.
External obstacle geometry remains fixed throughout solver iterations. These modes use discrete closest-point tests, not continuous collision detection.
See also Pulga Collision Force and Pulga Physics Solver.
Parametric obstacle domains#
The Domain selector adds Curve, Surface and Solid to the existing Vertices, Edges and Polygons obstacle modes. These are stationary external obstacles, not deformable self-collision geometry. The original Polygons mode and its absorption response are unchanged.
For parametric obstacles, the Method selector offers:
Fast: Precompute a discretized obstacle once for the simulation. Curves become polyline segments, surfaces become a triangular UV grid, and FreeCAD solids become a tessellated surface. The nearest-point calculations are exact for that discretized representation, not for the original shape.
Precise: Query nearest points directly on the parametric curve or surface using Sverchok’s numerical closest-point solvers (SciPy required), or on a FreeCAD solid using its geometric
distToShapeoperation. These are more expensive and numerical solvers do not guarantee the global mathematical minimum for all geometries.
Curve inputs:
Curve:
SvCurvegeometry. Collisions act like a tube around it, with radius equal to particle radius plus Thickness.Resolution: number of sampled points in Fast mode, including endpoints.
Initial Samples: initial samples for the Precise optimization.
Surface inputs:
Surface:
SvSurfacegeometry, with two-sided contact.Resolution U, Resolution V: numbers of sample points in the two parameter directions in Fast mode. Each grid cell becomes two triangles.
Initial Samples U, Initial Samples V: independent initial sampling counts for Surface Precise.
Solid inputs (FreeCAD required):
Solid: a FreeCAD
Part.Shape. The boundary is the collision surface.Deflection: absolute tessellation deflection in Fast mode. Smaller values yield a finer (slower and larger) collision mesh.
Fast classifies a particle as inside/outside using the nearest BVH triangle normal, as in Mesh (Volume). It requires a closed, outward- oriented tessellation and does not call
FreeCAD.isInsideeach step.Precise uses FreeCAD’s
distToShapeandisInsideon the original B-Rep. Both methods project contacts toward the boundary.
Absorption retains its role as a multiplier on the reflected velocity and force. Thickness adds to the radius of each simulated particle. The Fast representations are cached in the force object, which is reconstructed when Sverchok rebuilds the simulation; they are not recomputed per Pulga step.
Limitations#
The simulation uses discrete positional correction, not continuous collision sweeps, so fast-moving particles may tunnel through thin obstacles. Fast UV sampling currently covers the rectangular parametric domain and does not explicitly process trim boundaries. Precise surface queries use numerical minimization and may require more initial samples on complex surfaces. Fast Solid classification assumes a closed, outward-oriented mesh; Precise uses the FreeCAD solid for inside/outside checks.
Precise surface initial sampling#
In Surface / Precise mode, Initial Samples U / Initial Samples V control the number of samples along each parameter direction used to generate an initial guess for the numerical nearest-point optimization. These settings are independent of Resolution U / Resolution V, which apply only to Fast tessellation. For example, U=30 and V=8 builds 240 initial samples. Higher initial sampling can improve convergence but increases preparation cost for every nearest-point search. Curve / Precise retains its single Initial Samples value.