AR distance and area measurement implementation

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
AR distance and area measurement implementation
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1054
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing AR Distance and Area Measurement

AR measuring tape — one of few AR use cases where user immediately sees value. But production accuracy is painful: on iPhone 11 without LiDAR, error can reach 5-8%, on iPad Pro with LiDAR — less than 1%. Need to honestly communicate this difference at design stage.

LiDAR vs SLAM Measurements: Real Difference

Without LiDAR (ARKit Visual SLAM): ARKit determines distance via triangulation of feature points. Accuracy heavily depends on surface texture, lighting, camera path. Up to 2 meters — 2-4% error with good lighting. 5+ meters — 5-10%. Monochrome surfaces (white table, uniform floor) add +3-5% to error.

With LiDAR (iPhone 12 Pro+, iPad Pro): rangefinder shoots IR beam, error — 0.5-1.5% at distance up to 5 meters. ARKit with sceneReconstruction: .meshWithClassification builds dense mesh, from which you pick points without raycast along plane.

For app needing certification accuracy (construction, insurance, real estate), LiDAR — not option, requirement. For household use SLAM sufficient.

How Distance Measurement is Built

User taps screen — point created in world coordinates via raycast. Distance between two points — Euclidean distance in 3D space:

func distance(_ a: simd_float3, _ b: simd_float3) -> Float {
    return simd_distance(a, b)
}

To display line between points in RealityKit — ModelEntity with MeshResource.generateBox(size:) stretched along vector between points and rotated via simd_look(at:from:up:relativeTo:). Alternative — SCNGeometry with two vertices and .line primitive in SceneKit.

Text label with distance — ModelEntity with MeshResource.generateText() or billboard SCNNode with SCNBillboardConstraint to always face camera.

Area Measurement

Polygon area via points user places along perimeter. Gauss algorithm (shoelace formula) for 2D projection:

func polygonArea(_ points: [simd_float3]) -> Float {
    // Project to horizontal plane (XZ)
    var area: Float = 0
    let n = points.count
    for i in 0..<n {
        let j = (i + 1) % n
        area += points[i].x * points[j].z
        area -= points[j].x * points[i].z
    }
    return abs(area) / 2
}

Important nuance: if points placed on surface with slope (e.g., stairs), XZ projection gives underestimated area. For sloped surfaces need 3D area via cross product.

UI Pattern for Accurate Hit

Crosshair in screen center with confidence indicator — user should know when point fixed accurately. If ARKit returns ARRaycastResult with .estimatedPlane — show warning "aim at surface". If .existingPlaneGeometry — all good.

Snapping to already-placed points within < 5 cm in screen space — mandatory for closing polygon in area measurement. Without it, user can't precisely close contour.

Exporting Results

Typical requirements: save screenshot with applied measurements, export to PDF or JSON. ARView.snapshot(saveToHDR:completion:) in RealityKit. For PDF — UIGraphicsPDFRenderer with overlaid ARView.snapshot on schematic floor plan.

Timeline

Linear distance measurement with two points — 4-6 days. Multi-point area measurement with export — 10-14 days. LiDAR mesh picking support — additional 3-4 days. Cost calculated individually.