[general]
name=Borehole Geology Sections
qgisMinimumVersion=4.0
qgisMaximumVersion=4.99
description=Borehole logs, sedimentary records, geological cross sections (2D) and 3D lithology models from borehole data in two CSV files, currently supporting these coordinate systems (S-JTSK, WGS84, ETRS89)
about=Borehole Geology Sections turns borehole logs into geological models. Load two CSV files - a table of boreholes (name, X, Y, ground altitude, total depth) and a table of layers (borehole name, depth from, depth to, lithology, optional stratigraphy) - and the plugin shows the boreholes on the map, with coordinates in S-JTSK (EPSG:5514, also when written without the minus sign), WGS84 or ETRS89. Borehole logs: pick one to four boreholes and draw their profiles side by side with a depth ruler and layer descriptions, or draw sedimentary records in which the column width follows the grain size (clay, silt, sand, gravel) and a Legend lists the rock types; both can be exported to PNG, SVG and PDF, the profiles also show a stratigraphy column and the rocks can be drawn with the FGDC lithologic patterns. 2D cross sections: draw a section line on the map (or use a selected line feature) and the plugin projects nearby boreholes onto it and correlates layers of the same lithology between neighbouring boreholes, with dip-following boundaries, pinch-outs, lateral lithology changes, optional bedrock surface, highlighted boundaries between stratigraphic sequences and user-defined faults. Vertical exaggeration and colours per lithology are adjustable, and sections can be exported to PNG, SVG and PDF. 3D models: build either a grid model (blocks interpolated from the nearest boreholes) or a fence model made of 2D cross sections (chosen manually or generated automatically as N-S and E-W families) as closed 3D solids, ready to open in the QGIS 3D Map View or in the plugin's own 3D viewer (WebGL: smooth rotation, section planes, vertical exaggeration, transparency, lithology legend, borehole names, PNG export). Intended for geologists, hydrogeologists and engineering-geology work with borehole data.
version=0.25.3
author=Jan Hlinský
email=englishaj303@gmail.com
category=Plugins
tracker=https://github.com/englishaj303-arch/borehole_sections/issues
icon=icon.png
repository=https://github.com/englishaj303-arch/borehole_sections
homepage=https://github.com/englishaj303-arch/borehole_sections
changelog=0.25.3 - Security fixes for the 3D viewer (temporary directory), corrections to model calculations (grid_model database, borehole bridges, degenerate triangles) and a number of improvements to the WebGL viewer (textures, lighting, zoom slider, sorting of transparent layers and breaks).
	0.25.2 - fixed: profile header lines no longer overlap and the sediment record shows the dip of inclined holes; rulers of the sediment record keep their distance for long altitudes and the legend wraps long descriptions; thin hatching lines keep their contrast; pattern code is validated in tile_path; 3D viewer: no black pixels from degenerate triangles, hatching independent of the vertical scale, fault planes and edges sorted correctly with transparent layers, the page is rebuilt after a restored WebGL context (faults are kept), camera distance follows the vertical scale, fault name can be cleared while typing; walls on both sides of hole bridges are not generated; ear clipping drops a collinear last triangle; vertex merging uses the nearest vertex and faces met an odd number of times keep one copy; 3D window survives a failed or repeated dispose, keeps a reference to its page and hardens the web settings; viewer files are made in a private folder when TEMP is shared and removed 15 s after the browser got them at exit; duplicate boreholes are dropped in the grid model; invalid total depth is reported; unused argument removed
	0.25.1 - fixed: changelog written with real line breaks; no Qt 5 setPath() branch in the 3D viewer download; export from the 3D window (Save as HTML / Open in web browser) checks that the viewer file still exists after the faults are read; dynamic imports catch only ImportError / AttributeError / RuntimeError and log the reason; grid model: the Quaternary base g - qt is kept when cover and bedrock have the same lithology and the column ends in the cover; fence panels get the panel thickness explicitly (outward normals of zero-width wedges); warped quadrilaterals of smooth solids are split along the shorter diagonal; edge buffers of the 3D viewer are exported only when edges are switched on; boreholes without stratigraphy vote by depth also in the cover; the limit of objects covers panels + volume of the network model; scale NaN/inf and empty borehole lists in the logs; dip above 89 deg is limited (warning above 85 deg); delimiter detection ignores separators inside quotes; the reason of a failed coordinate transformation is reported; manual cross slope is enabled only in the manual mode; *.tsv in the file filter; fault lines of inclined boreholes are sampled along y; the jagged lithology transition joins the boundary smoothly; one shared point_in_polygon; open 2D section windows are marked and Regenerate is disabled after the data are reloaded
	0.25.0 - added: faults in the 3D viewer (panel Faults) - fault planes with position between two boreholes (or X, Y), dip direction, dip angle, length, top elevation and depth, colour, opacity and labels; the faults are kept by Save as HTML and Open in web browser
	0.24.1 - fixed: lambda assignment in model3d replaced by a def (flake8 E731)
	0.24.0 - fixed: code accepted by the QGIS Plugins Repository validator (Bandit B110/B112: no silent except-pass / except-continue, failures are logged or suppressed explicitly); temporary viewer files are removed also on macOS (real paths compared) and only regular files are deleted; the age cleanup does not run in a shared Windows TEMP outside the user profile; a failed write of the viewer file leaves no stub in the temp directory; the walls between blocks of the same lithology are removed also where one block has a quadrilateral and its pinching-out neighbour two triangles; pixmap and icon caches are cleared when the plugin is unloaded; no PyQt5 fallback in the embedded viewer; no deleteLater() on a half-built viewer window; removed unreachable download fallback code; 'Save as HTML' adds .html; pattern PNG files recompressed losslessly
	0.23.9 - changed: 'Reopen 3D viewer' with no model in the session shows again 'Create a fence model or a full model first.'
	0.23.8 - changed: 'Reopen 3D viewer' after the viewer in 'Open the created model in' was changed reports 'Previous model was created for a different viewer; please generate the model again.'; with no model at all it asks to create one
	0.23.7 - changed: a 3D model is created only for the viewer chosen in 'Open the created model in' (plugin's viewer in the web browser, or QGIS 3D layers) and opens in it automatically after it is built; a note under the selector asks to choose the viewer before the model is created; the button 'Open 3D viewer' was renamed 'Reopen 3D viewer (models created in this session)'
	0.23.6 - changed: every 3D model (fence, full, grid) is built for both outputs at once - the QGIS 3D layers and the plugin's 3D viewer - and the choice 'Open the created model in' is made only afterwards (it can be changed at any time, the model need not be rebuilt); removed: the checkbox 'Open the plugin's viewer in the web browser' from tab 3D model (the plugin's viewer always opens in the web browser)
	0.23.5 - removed: the combined output 'Plugin's 3D viewer + QGIS 3D layers' from the list in tab 3D model (left: Plugin's 3D viewer only, QGIS 3D layers only)
	0.23.4 - removed: the QGIS setting borehole_sections/ignore_gpu_blocklist and the Chromium flag --ignore-gpu-blocklist (the plugin no longer changes the QtWebEngine start-up of QGIS); the model is shown in the native QGIS 3D Map View (no WebGL) or in the web browser
	0.23.3 - fixed: ETRS89 / UTM zone 33N (EPSG:25833) boreholes were all skipped (the range check treated every CRS except S-JTSK as degrees; now only geographic CRS are checked in degrees); Esc in the embedded 3D viewer closes it properly (WebGL context and temporary file released); the embedded viewer accepts its own file on macOS (real paths compared, /var -> /private/var); smooth full model: the same number of mesh divisions in every triangle, so no gaps between neighbouring triangles; 2D section: stratigraphic boundary probe is limited by the thickness of thin layers, the fault line of inclined boreholes is cut where the boreholes cross; the embedded viewer refuses window.open()
	0.23.2 - fixed (QGIS 4): the button 'Open 3D viewer' follows 'Show the created model in' - 'QGIS 3D layers only' builds the 3D layers (also of models made earlier with the plugin's viewer only), zooms the canvas to the model and opens the native QGIS 3D Map View (no WebGL / QtWebEngine needed); 'Plugin's 3D viewer + QGIS 3D layers' opens both; the plugin's WebGL viewer opens in the web browser by default (the embedded QGIS browser often has no WebGL 2) and the message about missing WebGL 2 points to the native view
	0.23.1 - changed: the 3D viewer is never opened automatically after a model is created (also with 'Plugin's 3D viewer + QGIS 3D layers'); the QGIS 3D layers are created without touching the embedded browser, the viewer opens only with the 'Open 3D viewer' button
	0.23.0 - changed: borehole profile and sedimentary record windows are redrawn only by the Regenerate button (not when a drop-down or the merge box changes); the 2D section window is trimmed to the drawing (no empty band below the profile and the buttons); tab 3D model opens with 'Plugin's 3D viewer only' and the web browser box unticked; a missing WebGL 2 in the embedded viewer is reported in the message bar instead of a modal dialog; tab Data offers only CSV columns that have a heading
	0.22.9 - fixed: holes of 2D section polygons are joined to the outline by the shortest VISIBLE bridge (it must not cross or touch any edge and must run inside the polygon; concave polygons and polygons with several holes no longer get a bridge through the outside); a failed GEOS operation (makeValid, difference, combine) is written to the QGIS log, the polygon stays uncorrected, and a warning is shown in the message bar after the 2D section or the 3D fence model is built (a null result of difference() is no longer taken for an empty one); vertices of the 3D viewer meshes are merged by distance (0.1 mm, never finer than the float32 precision of WebGL at the model size) instead of by rounding to 1 mm, the stored coordinates are not snapped, faces with NaN/Inf are dropped; the embedded 3D viewer is not opened at all when its page with the navigation control cannot be created - the model opens in the web browser instead
	0.22.8 - fixed: concave quadrilateral faces were split along a diagonal outside the polygon (triangulate_face checks the diagonal and the triangles keep the winding of the face); the neighbours of a clipped ear are classified again; duplicate bridge vertices are ignored in the ear test; fence panel faces have outward normals in any outline direction; layers of the same lithology are matched between mesh nodes by elevation (sand-clay-sand next to a single sand) and a pinch-out tip lies on a boundary of the node's own layers; boreholes on one line get a chain of panels in Delaunay mode; anisotropic filtering is limited to the GPU maximum; depth picking on the far clipping plane; transparent layers are sorted in spatial chunks; the fault at the surface starts at the requested position on sloping ground; inclination of horizontal boreholes limited to 85 deg in the 2D correlation; side of a point at an inner vertex of a broken section line; the browser temporary file is kept for an hour and old files are removed when the plugin starts; explicit object-src 'none' in the CSP
	0.22.7 - fixed: the 3D viewer is released in the order view -> page -> profile when the plugin is unloaded; a missing QWebEngineSettings class no longer raises AttributeError; SVG and PDF export set the antialiasing render hints; the stratigraphy column test uses 'age is not None'
	0.22.6 - fixed: PNG export of a 2D section asks for the resolution (1x-4x), keeps the image within 100 million pixels and 30000 px per side (offers a reduced resolution instead of failing), and reports a failed allocation; input values are checked against plausible ranges (coordinates, elevation +-12000 m, depths up to 20000 m, degrees for WGS84/ETRS89) and boreholes or layers outside them are skipped with a warning
	0.22.5 - hardening: only about:blank may be navigated to in the embedded 3D viewer; CSV tables are limited to 1,000,000 rows, 1,000 columns and 32,768 characters per cell, the raw file data are released before the rows are built and a preview stops reading after the needed rows
	0.22.4 - fixed (QGIS 4): QgsCoordinateTransform gets the transform context (section line, DEM); DEM layer/provider/CRS is validated and reported; closing QGIS no longer raises RuntimeError for a deleted map canvas; NaN/Inf are not numbers (CSV, 3D viewer JSON is strict); delimiter detected from the first non-blank line; period names are matched as whole words (permeable, industrial); .png added to the name of the 3D viewer screenshot; picking in a minimized 3D viewer; PNG export of a very large 2D section is checked; blob: navigation allowed only in sub-frames; the smooth 3D meshes have a size limit checked before the loops; CSV reading accepts only regular files and reads at most the size limit
	0.22.3 - security: the scene data in the 3D viewer page have every < > & escaped (no markup from a borehole or lithology name can reach the HTML parser); the preview of CSV column names reads at most 256 KB and a path that is being typed is ignored; data: navigation is blocked in the embedded viewer and the suggested PNG name is reduced to a file name; temporary files given to a web browser are also deleted when the plugin is unloaded. fixed: selection of a feature without geometry / a multi-line with an empty first part; stratigraphic boundaries of a 2D section (new option Show stratigraphic boundaries when the section opens); colours of jilovec (claystone) and sandstone were never reached; an empty column drop-down is reported when data are loaded; NULL borehole names in the selection; equal column names in a CSV header get unique names; old Mac line ends (CR) in CSV files; boreholes without stratigraphy no longer shift the layers of the 3D models (grid and full model, mode depth); viewer: missing origin in the scene data, lost WebGL context is reported; the page is deleted only together with its own profile
	0.22.2 - security: the 3D viewer page has a strict Content-Security-Policy (no network requests) and the embedded window can show only the viewer file itself (other navigation is blocked); CSV files over 100 MB and binary files (NUL bytes) are rejected; colours passed to the viewer are validated. fixed: arc (curved) section lines were not converted to straight segments; the prolongation of the section line ends could cut a broken line (wrong stationing); the temporary file of a viewer opened in the web browser is deleted 10 minutes later (not at once, not never); the red section line is removed from the map when the dialog is closed and drawn again when it is reopened; a foreign layer called 'Boreholes' without the attribute name no longer crashes the plugin; holes of polygons were lost when overlaps were removed; DEM NoData samples are interpolated, so the fence panels and the volume agree; page is released before its profile when the plugin is unloaded; SVG/PDF export checks an empty scene and a locked file; UTF-16 CSV files (Excel Unicode text) can be read; texture mipmaps of the viewer are built once
	0.22.1 - security: the embedded 3D viewer has its own private (off-the-record) web profile and its download handler is disconnected on close; the unsafe software-WebGL flag --enable-unsafe-swiftshader is no longer used (only the optional, default-off QGIS setting borehole_sections/ignore_gpu_blocklist; without a usable GPU the viewer opens in the web browser); the temporary 3D viewer file is deleted when the window is closed and old ones after 6 hours. fixed: section line rubber band drawn with the layer CRS; layer without a valid CRS is reported; total borehole depth with overlapping layers (deepest bottom); the correlation of inclined boreholes in the fence uses the collar elevations; the ground slope of a nearly vertical projection is limited; auto-detection of the delimiter knows | and space; reading only the header of a big CSV when a file is selected; previous 3D models and lithology list are cleared when new data are loaded; PNG export of the viewer without a blob; 3D viewer window without a parent; wait cursor always restored; faster filling of the lithology table (one shared pattern model)
	0.22.0 - 2D section: better rendering of inclined boreholes (integrated from the separate 0.19.0 branch) - the signed distances of the collar and of the bottom from the section line (from the azimuth and the inclination) give the distance of every layer boundary from the section plane and the elevations are moved into the plane along the strata (new option Heights of layers in the section plane: auto from the ground slope across the line, manual cross slope, or off); the ground line and the columns use the same corrected heights
	0.21.2 - security: the 3D viewer file is written as a unique temporary file readable only by the current user (no predictable name or shared folder); the software-WebGL flags of QtWebEngine are set only when the 3D viewer is opened for the first time (can be switched off: setting borehole_sections/software_webgl=false). fixed: NaN NoData values of a DEM spoiled the 3D model; fault line drawn through the Quaternary cover when both boreholes had only Quaternary; section line with an unusable CRS raised an unhandled error; thin Quaternary cover (< dz/2) disappeared in the grid model; mesh nodes of neighbouring triangles of the smooth fence volume did not coincide; wedges of layers pinching out could stick out above the terrain; lost precision of the Delaunay triangulation in S-JTSK; PNG export of the 3D viewer was silently dropped when the window lost focus; negative borehole depth; curved (arc) section lines; blank CSV column headers; wait cursor when building the fence model; cleanup of the plugin action on unload; removed unused code
	0.21.1 - code quality: removed the Bandit warnings 'Try, Except, Continue detected' in the 3D viewer window (QtWebEngine and WebGL settings lookup refactored into helper functions, behaviour unchanged)
	0.21.0 - new: FULL 3D model made directly from the boreholes with smooth layers (tab 3D model, group B, method Smooth layers): mesh nodes interpolate the layer stack from the nearest boreholes with continuous weights, layers are joined into closed sloped bodies with exact boundaries, extent = hull of the boreholes or a rectangle; the old brick model stays as method Blocks; 3D viewer: checkbox Lithology textures (hatching) with Texture size slider - the FGDC patterns chosen in tab 2 are drawn on tops and walls, pattern thumbnails in the layer list
	0.20.2 - fixed: closing the embedded 3D viewer (or unloading the plugin) wrongly reported 'no WebGL 2' and opened the web browser
	0.20.1 - embedded 3D viewer: the plugin allows the software WebGL renderer of QtWebEngine (flags --ignore-gpu-blocklist, --enable-unsafe-swiftshader, effective after restarting QGIS) and enables the WebGL settings; when the embedded browser still has no WebGL 2, the viewer switches to the web browser for the following models and the reason is written to the QGIS log
	0.20.0 - fence model: layers are interpolated between the 2D sections as smooth closed solids with sloped tops and bottoms (nodes of a fine triangular mesh read the layer stack from the three surrounding sections, boundaries are exact, layers pinch out smoothly, neighbouring triangles meet without gaps) instead of blocks; the old block method stays selectable (Interpolation); 3D viewer: docked side panel in the style of the 2D section windows with a layer list (tick = visible, colour, selection by click in the list or in the model), opacity slider for the selected layers, hide / show / show only selected, double-click shows only one layer; the global opacity slider was replaced by per-layer opacity
	0.19.0 - own 3D viewer (tab 5): the fence and grid models open in a WebGL viewer built into the plugin (embedded QtWebEngine window, or the default web browser when QGIS has no QtWebEngine) - rotate / pan / zoom, perspective or orthographic view, vertical exaggeration, transparency, section plane along X, Y or Z, lithology legend with tick boxes and colour pickers, borehole traces and names, picking of lithology, coordinates and elevation, PNG export and saving as one self-contained HTML file; new selector Show the created model in (viewer + QGIS layers / viewer only / QGIS layers only); no extra Python package is needed
	0.18.2 - borehole log windows: the side panel is split into sections, each drop-down changes only its own item and redraws the log (profiles: Lithology, Lithological description, Stratigraphy - column of the stratigraphy can be chosen or switched off; sedimentary records: Lithology and Legend); the Index of the sedimentary record is renamed to Legend
	0.18.1 - bug fix: boreholes with identical data at the same place were not left out of the 3D fence model
	0.18.0 - fixed the error min() iterable argument is empty in the 3D fence model (boreholes at the same place, e.g. MK 111 = HV 111, are left out); 2D section: a borehole is drawn dashed only when the section line misses the circular marker of the Boreholes layer at the current map scale (new field Dashed outline farther than, auto or in metres)
	0.17.0 - 2D section: boreholes off the section line have a dashed outline on a white halo (readable above lithologic patterns); tab 5: Fence model is now A) and Grid model B); fence model can fill the space between the sections (checkbox, every triangle of boreholes is interpolated from its three sections); list with tick boxes to show or hide single lithologies of the 3D models; grid model blocks are closed 3D bodies like the fence model (no extrusion style needed)
	0.16.0 - 3D: fence model made of smooth closed 3D solids (PolygonZ faces) instead of stepped blocks, terrain from a DEM followed without quantisation; grid model has one layer per lithology (data-defined extrusion height), its top is the ground surface and the Quaternary base is exact; block edges are optional (off by default); borehole columns follow inclined boreholes; README updated
	0.15.1 - bug fixes
	0.15.0 - 2D section: boreholes that do not lie on the section line (farther than 1 m) are drawn with dashed edges; new option Min. spacing of boreholes (default 5 m, 0 = off): of boreholes that are almost at the same point only the one nearer to the section line is used
	0.14.0 - Support for inclined boreholes: optional azimuth (0-360 deg clockwise from North) and dip/deviation (0-90 deg from vertical) columns in tab 1; inclined 2D section projection, column geometry, and stratigraphic correlation in tab 4; inclined 3D borehole intervals, grid blocks, fence panels, and borehole pillars in tab 5
	0.13.0 - borehole profiles and sedimentary records: side panel (column for the description, column for the profile, merge identical lithologies, Regenerate); separate window for each borehole also for profiles; description column before stratigraphy column; hanging labels with slanted lines for thin layers; high-resolution FGDC patterns (CC0, FGDC-STD-013-2006) with a separate licence section
	0.12.0 - FGDC lithologic patterns (117 patterns, e.g. 620 Clay or clay shale as dashes): pattern column in tab 2 (default guessed from the lithology name), used in the borehole logs and sedimentary records of tab 3 instead of the grain-size hatching, and optional in the Geological cross section window (Lithologic patterns); borehole profiles have a stratigraphy column next to the lithology column; removed the Highlight boundaries between stratigraphic sequences checkbox from tab 4
	0.11.4 - plugin window fits on the screen (size limited to 90 percent of the screen, tabs scroll when the window is small); removed the grey stratigraphy help text from tab 1 (it stays as a tooltip of the Stratigraphy field); smaller log window at the bottom of tab 1
	0.11.3 - 2D section: new checkbox for hatching by grain size in the section window; stratigraphic boundaries and the ground surface line are switched off by default
	0.11.2 - small bug fixes
	0.11.1 - metadata.txt changes: qgisMaximumVersion=4.99 instead of the deprecated supportsQt6
	0.11.0 - new tab 3 Borehole logs (profiles of 1-4 boreholes and sedimentary records with grain size); 2D section is now tab 4 and 3D model tab 5; grain size column in tab 2; gravel (štěrk) recognised in default colours
	0.10.1 - fixed gaps between Quarternary and older layers in 2D sections
	0.10 - added stratigraphy boundary function and improved rendering of layer splitting
	0.9.1 - menu for creating faults has been moved to the window displaying cross-sections
	0.9 - added function of faults in cross sections
	0.8.1 - fixed gaps ocuring on edges of different lithologies
	0.8 - changes to the rendering of cross-sections for a smoother result
	0.7 - added function for merging neighbouring layers of same litology in section
	0.6.1 - added Stratigraphy line on Data tab
	0.6 - changes in Cross-section creation logic
	0.5.1 - bug fixes in 2D section tab
	0.5 - changes in 2D section tab design 
	0.4 - added 2D section tab and 3D model tab
	0.3 - added tab Lithology colours
	0.2.1 - fixed bug with importing data on Data tab in S-JTSK coordinates system without minus
	0.2 - improved importing tab Data
	0.1 - initial release
experimental=True
deprecated=False
tags=geology,borehole,cross section,3D,S-JTSK

