Skip to content

3D Farm Designer #2457

@roryaronson

Description

@roryaronson

Replace the 2D, SVG based farm designer with a fully 3D, three.js based farm designer. Demo.

FarmBot 3D Demo

Coordinate system

As most objects in the scene (the gantry, plants, grid lines, points, etc) will need to be positioned based off the FarmBot's origin, it maybe makes the most sense for the three.js origin and the FarmBot origin to be one in the same. This will avoid having to translate/rotate the majority of objects, and the three.js coordinates will always equal the FarmBot coordinates. Meanwhile, the rest of the environment (camera position/angle, ground plane, sun, etc will need to be translated/rotated accordingly based on the bearing and size of the bot.

Perhaps other origins would make more sense though, such as the top center of the soil, top center of the ground, top of the raised bed at the home position. This should be discussed a bit more so the best architecture is chosen.

Environment

  • Ground plane with customizable color hex code (GROUND COLOR), default to #f4f4f4.
  • Customizable setting in degrees of the FarmBot bed relative to North (BEARING). Default to 0 deg, which should make the positive Y direction of the FarmBot axes pointing towards North. When the user has the bearing field selected, show a large North arrow and "N" on the ground plane.
  • Customizable starting camera position (DEFAULT VIEWPOINT) for when the app loads. Options include each corner, each side, and top-down. Default should be from the max-X/min-Y corner. Starting camera angle should always be pointed at the top center of the soil. Starting camera height should always be at an eye-level height of 1600mm. Distance from the center of the bed should be based on bed dimensions to fit the whole bed in view with some margin.
  • Add outer bed dimension fields for X (OUTER BED LENGTH), Y (OUTER BED WIDTH), and Z (OUTER BED HIEGHT) in millimeters. X and Y should default to the recommended max outer dimensions listed in the hardware docs. Z should default to 300mm.
  • Add a BED WALL THICKNESS field, default to 40mm.
  • Add an OVERALL BED HEIGHT field, to allow for the bed to be raised off the ground plane (mobile raised beds, bots on tables, etc). Default to 300mm. When this value exceeds the outer bed height, render 90mm x 90mm (4x4) legs in the corners of the bed.
  • Bed should have a customizable color hex code (BED COLOR), default to #c39f7a.
  • Add ambient light.
  • Add directional point light for the Sun, coming from the South East (afternoon light).
  • Add ability to turn on/off PERSPECTIVE.
  • Render soil height in 3D according to soil height measurements, interpolations, and fallback height.
  • Add a utilities pole.
  • Profile viewer as a special camera setting for the main farm designer view where perspective is turned off and the camera's view is clipped at a min and max distance.
  • Change the Sun's position, color, and intensity based on the time of day and lat/lon.

Grid

  • Add 100mm grid lines.
  • Add crosshairs and coordinate labels at cursor whenever mousing over the soil surface or once clicked into a coordinate.
  • Setting to show/hide GRID in the map legend.
  • Show alignment indicators when adding plants and points.

Tools

  • 1-slot toolbays (to allow for fine adjustments of individual slot coordinates) (no FarmBot logos, it will look tacky to have so many).
  • Seeder.
  • Seed bins, trays, troughs.
  • Watering nozzle.
  • Soil sensor.
  • Rotary Tool.
  • Legacy weeder.
  • Render ghost tool in slot when mounted to the UTM.
  • Watering animations
  • Vacuum pump animation
  • Rotary tool animation

FarmBot

Initial 3D assets should be from the Genesis v1.7 design. We can eventually add the old style tracks for v1.6- bots, and the 3-in-1 tool head and different gantry wheel plates for Express bots. All other assets can remain the same amongst all bots.

  • Import separate objects for major subassemblies. Make sure these are cached by the browser for a week+.
  • Track extrusions: create object programmatically by extruding geometry so it can have dynamic length.
  • Left and right wheel plates (allows for eventual Express/Genesis differences).
  • Left and right gantry columns via extruded geometry (allows for dynamic length and performance improvements).
  • Left and right gantry corner brackets.
  • Main beam extruded geometry.
  • Cross-slide.
  • Z-axis.
  • UTM.
  • Cable carrier curves: basic C shaped object, moves at half the speed of the FarmBot.
  • Cable carrier straight sections: rectangular prisms positioned between curve and end positions. Length is dynamic based on distance between curve and ends.
  • Add lights along the gantry, illuminated when the LED strip is on.
  • Solenoid valve assembly with some basic tubing extending along the column.
  • Render Trail from the UTM in 3D.
  • Rendering of X axis belts.
  • Rendering of Y axis belt.

Plants, Weeds, Points

  • Render plant and weed icons as sprites (always facing the camera).
  • Render a green spread sphere for plants
  • Render a white spread sphere when adding plants (individual and grid/row)
  • When spread is turned on, render a weed's current size with a red sphere (#ee6666, opacity 0.8) according to the weed's radius. This is in addition to the icon; the sphere should envelope the icon.
  • Render points as pins with rings
  • Render selection ring around object when item details panel is opened or when hovered over in a list.
  • Render numbers and selection rings around group members when group details panel is opened.

Photos

  • Render images on soil surface.
  • Clip images at inner bed edges.
  • Filter images by calibration, date, time, etc.
  • Render camera view in 3D (cyan rectangle on soil surface + cyan lines extending from corners to camera lens).
  • Photo taking animation (Pulse of the viewport lines + glowing rectangle ascends from soil surface up into camera)
  • Camera calibration animation (laser scan plane + calibration card shown at soil level)
  • Measure soil height animation (randomized exaggerated grid shifting beneath viewport)
  • Detect weeds animation (laser scan plane moving back and forth through viewport, a few small weed objects appearing and vanishing in viewport with each scan)
  • Add button in photos panel to zoom farm designer to the camera's view (+~50% field of view to provide context).

Multi-select mode

  • Ability to multi-select via Cmd+Click or Shift+Click.
  • Cmd/shift+Click and Drag for box selection.
  • Render selection rings around selected objects.

Future

  • Change the lighting based on the weather. Animation/effect for rain, snow.
  • Replace the SVG graphics in the tool details panel with a slowly bounce hovering 3D model.
  • Lay the groundwork for visualization of point clouds and other 3D data.
  • Ability for users to add and position other basic elements to the environment such as walls, buildings, another raised bed, solar panels, trees, hedges, etc.
  • Overlay a satellite image onto the ground plane.
  • Ability for users to add and position other common gardening objects such as starter trays and pots.
  • Ability to open the electronics box and get a detailed view of the Farmduino/Pi, along with various controls and info.
  • Eventual moving of other controls and app interactions into the 3D environment. For example, we could render a little mailbox on top of the utilities pole and a pulsing blue sphere for when the user has mail in the message center. Manual control buttons could be floating near the relevant parts of the FarmBot when in a controls mode. Connectivity info and settings could be found inside the electronics box. Documentation could be opened by clicking a 3D manual located near the utilities pole. Etc. Lots of fun to be had!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions