Abstract The present work aims at introducing a basic theory, implementing methodology and algorithms for 3-D modeling, and visualizing a geologic model using the Open Source Free GIS GRASS environment. A 3-D geologic model is constructed from the boundary surfaces of geologic units and the logical model of geologic structure. The algorithms for construction and visualization of the proposed model are based on the geologic function g. The geologic function g assigns a unique geologic unit to every point in the objective 3-D space. The boundary surface that divides the objective space into two subspaces is estimated using data from field survey. The logical model showing the hierarchical relationship between these boundary surfaces and geologic units can be automatically generated based on the stratigraphic sequence and knowledge of geologic structures. Based on these algorithms, a 3-D geologic model can be constructed virtually in the GRASS GIS. Applying this model, various geologic surfaces and section models can be visualized in the GRASS GIS environment. “Nviz” was used for dynamic visualization of geologic cross-sections and generation of animated image sequences. Further, the described algorithms and methods are applied and an online 3-D geologic modeling system is developed.