diff --git a/ApplicationLibCode/ModelVisualization/Intersections/RivPolylineIntersectionGeometryGenerator.cpp b/ApplicationLibCode/ModelVisualization/Intersections/RivPolylineIntersectionGeometryGenerator.cpp index a376f326fd..d62a9c36a8 100644 --- a/ApplicationLibCode/ModelVisualization/Intersections/RivPolylineIntersectionGeometryGenerator.cpp +++ b/ApplicationLibCode/ModelVisualization/Intersections/RivPolylineIntersectionGeometryGenerator.cpp @@ -165,10 +165,9 @@ void RivPolylineIntersectionGeometryGenerator::calculateArrays( cvf::UByteArray* std::vector polygonToCellIndexMap = {}; // Welder for segment vertices - // - Number of buckets is size of columnCellCandidates divided by 8 to avoid too many buckets (Random selected value). - // Usage of columnCellCandidates is to get a dynamic number of buckets usable for respective segment. - const cvf::uint numWelderBuckets = static_cast( columnCellCandidates.size() / size_t( 8 ) ); + // - Number of buckets is size of columnCellCandidates to get a dynamic number of buckets usable for respective segment. cvf::VertexWelder segmentVertexWelder; + const cvf::uint numWelderBuckets = std::max( static_cast( columnCellCandidates.size() ), cvf::uint( 1 ) ); segmentVertexWelder.initialize( weldingDistance, weldingCellSize, numWelderBuckets ); // Intersection per grid cell - transform from set of triangles to polygon for cell diff --git a/GrpcInterface/Python/rips/WebvizPythonExamples/drogon_grid_well_path_polyline_xy_utm.py b/GrpcInterface/Python/rips/WebvizPythonExamples/drogon_grid_well_path_polyline_xy_utm.py new file mode 100644 index 0000000000..fa9a1c26dd --- /dev/null +++ b/GrpcInterface/Python/rips/WebvizPythonExamples/drogon_grid_well_path_polyline_xy_utm.py @@ -0,0 +1,1016 @@ +drogon_well_path_polyline_xy_utm = [ + 463256.911, + 5930542.294, + 463259.476, + 5930546.594, + 463262.041, + 5930550.894, + 463264.606, + 5930555.194, + 463267.172, + 5930559.494, + 463269.737, + 5930563.793, + 463272.302, + 5930568.093, + 463274.867, + 5930572.393, + 463277.433, + 5930576.693, + 463279.998, + 5930580.993, + 463282.563, + 5930585.293, + 463285.129, + 5930589.593, + 463287.694, + 5930593.892, + 463290.259, + 5930598.192, + 463292.825, + 5930602.492, + 463295.39, + 5930606.792, + 463297.955, + 5930611.092, + 463300.521, + 5930615.392, + 463303.086, + 5930619.691, + 463305.651, + 5930623.991, + 463308.217, + 5930628.291, + 463310.782, + 5930632.591, + 463313.347, + 5930636.891, + 463315.913, + 5930641.191, + 463318.478, + 5930645.491, + 463321.043, + 5930649.79, + 463323.608, + 5930654.09, + 463326.174, + 5930658.39, + 463328.739, + 5930662.69, + 463331.304, + 5930666.99, + 463333.87, + 5930671.29, + 463336.435, + 5930675.59, + 463339, + 5930679.889, + 463341.566, + 5930684.189, + 463344.131, + 5930688.489, + 463346.696, + 5930692.789, + 463349.262, + 5930697.089, + 463351.827, + 5930701.389, + 463354.392, + 5930705.689, + 463356.957, + 5930709.988, + 463359.523, + 5930714.288, + 463362.088, + 5930718.588, + 463364.653, + 5930722.888, + 463367.218, + 5930727.188, + 463369.784, + 5930731.488, + 463372.349, + 5930735.788, + 463374.914, + 5930740.088, + 463377.48, + 5930744.388, + 463380.045, + 5930748.687, + 463382.61, + 5930752.987, + 463385.175, + 5930757.287, + 463387.741, + 5930761.587, + 463390.306, + 5930765.887, + 463392.871, + 5930770.187, + 463395.436, + 5930774.487, + 463398.001, + 5930778.787, + 463400.567, + 5930783.087, + 463403.132, + 5930787.387, + 463405.697, + 5930791.686, + 463408.262, + 5930795.986, + 463410.827, + 5930800.286, + 463413.393, + 5930804.586, + 463415.958, + 5930808.886, + 463418.523, + 5930813.186, + 463421.088, + 5930817.486, + 463423.653, + 5930821.786, + 463426.218, + 5930826.086, + 463428.784, + 5930830.386, + 463431.349, + 5930834.686, + 463433.914, + 5930838.986, + 463436.479, + 5930843.286, + 463439.044, + 5930847.586, + 463441.609, + 5930851.886, + 463444.174, + 5930856.186, + 463446.739, + 5930860.486, + 463449.304, + 5930864.786, + 463451.869, + 5930869.086, + 463454.435, + 5930873.386, + 463457, + 5930877.686, + 463459.565, + 5930881.986, + 463462.13, + 5930886.286, + 463464.695, + 5930890.586, + 463467.26, + 5930894.886, + 463469.825, + 5930899.186, + 463472.39, + 5930903.486, + 463474.955, + 5930907.786, + 463477.52, + 5930912.086, + 463480.085, + 5930916.386, + 463482.649, + 5930920.686, + 463485.214, + 5930924.986, + 463487.779, + 5930929.286, + 463490.344, + 5930933.586, + 463492.909, + 5930937.886, + 463495.474, + 5930942.187, + 463498.039, + 5930946.487, + 463500.604, + 5930950.787, + 463503.168, + 5930955.087, + 463505.733, + 5930959.387, + 463508.298, + 5930963.687, + 463510.862, + 5930967.988, + 463513.427, + 5930972.288, + 463515.992, + 5930976.588, + 463518.556, + 5930980.888, + 463521.121, + 5930985.189, + 463523.686, + 5930989.489, + 463526.25, + 5930993.789, + 463528.814, + 5930998.09, + 463531.379, + 5931002.39, + 463533.943, + 5931006.691, + 463536.507, + 5931010.991, + 463539.072, + 5931015.291, + 463541.636, + 5931019.592, + 463544.2, + 5931023.893, + 463546.764, + 5931028.194, + 463549.327, + 5931032.494, + 463551.891, + 5931036.795, + 463554.454, + 5931041.096, + 463557.017, + 5931045.398, + 463559.58, + 5931049.699, + 463562.141, + 5931054.001, + 463564.7, + 5931058.305, + 463567.247, + 5931062.615, + 463569.787, + 5931066.93, + 463572.321, + 5931071.249, + 463574.851, + 5931075.569, + 463577.378, + 5931079.892, + 463579.903, + 5931084.215, + 463582.427, + 5931088.54, + 463584.949, + 5931092.865, + 463587.469, + 5931097.192, + 463589.988, + 5931101.519, + 463592.506, + 5931105.846, + 463595.023, + 5931110.175, + 463597.54, + 5931114.503, + 463600.055, + 5931118.832, + 463602.57, + 5931123.162, + 463605.084, + 5931127.492, + 463607.597, + 5931131.823, + 463610.11, + 5931136.153, + 463612.622, + 5931140.485, + 463615.133, + 5931144.816, + 463617.644, + 5931149.148, + 463620.154, + 5931153.481, + 463622.663, + 5931157.813, + 463625.172, + 5931162.147, + 463627.679, + 5931166.48, + 463630.186, + 5931170.815, + 463632.691, + 5931175.15, + 463635.194, + 5931179.486, + 463637.691, + 5931183.826, + 463640.162, + 5931188.181, + 463642.621, + 5931192.542, + 463645.077, + 5931196.906, + 463647.529, + 5931201.271, + 463649.98, + 5931205.637, + 463652.429, + 5931210.004, + 463654.876, + 5931214.372, + 463657.322, + 5931218.741, + 463659.767, + 5931223.111, + 463662.21, + 5931227.481, + 463664.651, + 5931231.853, + 463667.091, + 5931236.225, + 463669.53, + 5931240.598, + 463671.966, + 5931244.972, + 463674.4, + 5931249.348, + 463676.832, + 5931253.725, + 463679.26, + 5931258.103, + 463681.685, + 5931262.484, + 463684.105, + 5931266.867, + 463686.519, + 5931271.253, + 463688.924, + 5931275.645, + 463691.312, + 5931280.046, + 463693.692, + 5931284.451, + 463696.071, + 5931288.857, + 463698.45, + 5931293.262, + 463700.829, + 5931297.668, + 463703.207, + 5931302.074, + 463705.586, + 5931306.48, + 463707.964, + 5931310.886, + 463710.342, + 5931315.292, + 463712.72, + 5931319.698, + 463715.098, + 5931324.105, + 463717.475, + 5931328.511, + 463719.853, + 5931332.918, + 463722.23, + 5931337.324, + 463724.607, + 5931341.731, + 463726.984, + 5931346.138, + 463729.361, + 5931350.544, + 463731.738, + 5931354.951, + 463734.115, + 5931359.358, + 463736.491, + 5931363.765, + 463738.868, + 5931368.172, + 463741.244, + 5931372.579, + 463743.62, + 5931376.987, + 463745.996, + 5931381.394, + 463748.372, + 5931385.801, + 463750.748, + 5931390.208, + 463753.124, + 5931394.616, + 463755.499, + 5931399.023, + 463757.875, + 5931403.431, + 463760.25, + 5931407.839, + 463762.625, + 5931412.246, + 463765, + 5931416.654, + 463767.375, + 5931421.062, + 463769.75, + 5931425.47, + 463772.124, + 5931429.878, + 463774.499, + 5931434.286, + 463776.873, + 5931438.694, + 463779.247, + 5931443.103, + 463781.622, + 5931447.511, + 463783.995, + 5931451.919, + 463786.369, + 5931456.328, + 463788.743, + 5931460.736, + 463791.116, + 5931465.145, + 463793.489, + 5931469.554, + 463795.862, + 5931473.963, + 463798.235, + 5931478.372, + 463800.608, + 5931482.781, + 463802.981, + 5931487.19, + 463805.353, + 5931491.599, + 463807.725, + 5931496.009, + 463810.097, + 5931500.418, + 463812.469, + 5931504.828, + 463814.84, + 5931509.237, + 463817.211, + 5931513.647, + 463819.583, + 5931518.057, + 463821.953, + 5931522.467, + 463824.324, + 5931526.877, + 463826.694, + 5931531.288, + 463829.064, + 5931535.698, + 463831.434, + 5931540.109, + 463833.804, + 5931544.52, + 463836.173, + 5931548.931, + 463838.542, + 5931553.342, + 463840.91, + 5931557.753, + 463843.279, + 5931562.164, + 463845.647, + 5931566.576, + 463848.014, + 5931570.988, + 463850.381, + 5931575.4, + 463852.748, + 5931579.812, + 463855.114, + 5931584.225, + 463857.48, + 5931588.637, + 463859.846, + 5931593.05, + 463862.211, + 5931597.463, + 463864.575, + 5931601.877, + 463866.939, + 5931606.291, + 463869.302, + 5931610.705, + 463871.665, + 5931615.12, + 463874.026, + 5931619.535, + 463876.387, + 5931623.95, + 463878.748, + 5931628.366, + 463881.107, + 5931632.782, + 463883.465, + 5931637.199, + 463885.822, + 5931641.616, + 463888.178, + 5931646.034, + 463890.532, + 5931650.453, + 463892.885, + 5931654.873, + 463895.236, + 5931659.294, + 463897.585, + 5931663.716, + 463899.93, + 5931668.139, + 463902.273, + 5931672.564, + 463904.612, + 5931676.991, + 463906.945, + 5931681.421, + 463909.27, + 5931685.856, + 463911.582, + 5931690.296, + 463913.886, + 5931694.742, + 463916.187, + 5931699.189, + 463918.486, + 5931703.637, + 463920.783, + 5931708.085, + 463923.08, + 5931712.534, + 463925.376, + 5931716.984, + 463927.671, + 5931721.434, + 463929.966, + 5931725.884, + 463932.261, + 5931730.334, + 463934.555, + 5931734.784, + 463936.849, + 5931739.235, + 463939.143, + 5931743.685, + 463941.437, + 5931748.136, + 463943.73, + 5931752.587, + 463946.023, + 5931757.038, + 463948.316, + 5931761.489, + 463950.609, + 5931765.94, + 463952.902, + 5931770.391, + 463955.195, + 5931774.843, + 463957.487, + 5931779.294, + 463959.78, + 5931783.745, + 463962.072, + 5931788.197, + 463964.364, + 5931792.648, + 463966.656, + 5931797.099, + 463968.948, + 5931801.551, + 463971.24, + 5931806.002, + 463973.532, + 5931810.454, + 463975.824, + 5931814.906, + 463978.116, + 5931819.357, + 463980.407, + 5931823.809, + 463982.699, + 5931828.261, + 463984.99, + 5931832.712, + 463987.282, + 5931837.164, + 463989.573, + 5931841.616, + 463991.865, + 5931846.068, + 463994.156, + 5931850.52, + 463996.448, + 5931854.972, + 463998.739, + 5931859.424, + 464001.03, + 5931863.876, + 464003.321, + 5931868.328, + 464005.613, + 5931872.78, + 464007.904, + 5931877.232, + 464010.195, + 5931881.684, + 464012.486, + 5931886.136, + 464014.777, + 5931890.588, + 464017.068, + 5931895.04, + 464019.359, + 5931899.492, + 464021.65, + 5931903.944, + 464023.941, + 5931908.396, + 464026.231, + 5931912.848, + 464028.522, + 5931917.3, + 464030.813, + 5931921.753, + 464033.104, + 5931926.205, + 464035.395, + 5931930.657, + 464037.685, + 5931935.109, + 464039.976, + 5931939.561, + 464042.267, + 5931944.014, + 464044.557, + 5931948.466, + 464046.848, + 5931952.918, + 464049.139, + 5931957.37, + 464051.429, + 5931961.823, + 464053.72, + 5931966.275, + 464056.01, + 5931970.727, + 464058.301, + 5931975.18, + 464060.591, + 5931979.632, + 464062.882, + 5931984.084, + 464065.172, + 5931988.537, + 464067.463, + 5931992.989, + 464069.753, + 5931997.441, + 464072.043, + 5932001.894, + 464074.334, + 5932006.346, + 464076.624, + 5932010.798, + 464078.915, + 5932015.251, + 464081.205, + 5932019.703, + 464083.495, + 5932024.156, + 464085.786, + 5932028.608, + 464088.076, + 5932033.06, + 464090.366, + 5932037.513, + 464092.656, + 5932041.965, + 464094.947, + 5932046.418, + 464097.237, + 5932050.87, + 464099.527, + 5932055.323, + 464101.817, + 5932059.775, + 464104.108, + 5932064.228, + 464106.398, + 5932068.68, + 464108.688, + 5932073.133, + 464110.978, + 5932077.585, + 464113.268, + 5932082.038, + 464115.558, + 5932086.49, + 464117.848, + 5932090.943, + 464120.139, + 5932095.395, + 464122.429, + 5932099.848, + 464124.719, + 5932104.3, + 464127.009, + 5932108.753, + 464129.299, + 5932113.205, + 464131.589, + 5932117.658, + 464133.879, + 5932122.11, + 464136.169, + 5932126.563, + 464138.459, + 5932131.016, + 464140.749, + 5932135.468, + 464143.039, + 5932139.921, + 464145.329, + 5932144.373, + 464147.619, + 5932148.826, + 464149.909, + 5932153.278, + 464152.199, + 5932157.731, + 464154.489, + 5932162.184, + 464156.779, + 5932166.636, + 464159.069, + 5932171.089, + 464161.359, + 5932175.542, + 464163.648, + 5932179.994, + 464165.938, + 5932184.447, + 464168.228, + 5932188.899, + 464170.518, + 5932193.352, + 464172.808, + 5932197.805, + 464175.098, + 5932202.257, + 464177.388, + 5932206.71, + 464179.678, + 5932211.163, + 464181.967, + 5932215.615, + 464184.257, + 5932220.068, + 464186.547, + 5932224.521, + 464188.837, + 5932228.973, + 464191.127, + 5932233.426, + 464193.417, + 5932237.879, + 464195.706, + 5932242.331, + 464197.996, + 5932246.784, + 464200.286, + 5932251.237, + 464202.576, + 5932255.689, + 464204.865, + 5932260.142, + 464207.155, + 5932264.595, + 464209.445, + 5932269.048, + 464211.735, + 5932273.5, + 464214.024, + 5932277.953, + 464216.314, + 5932282.406, + 464218.604, + 5932286.858, + 464220.894, + 5932291.311, + 464223.183, + 5932295.764, + 464225.473, + 5932300.217, + 464227.763, + 5932304.669, + 464230.052, + 5932309.122, + 464232.342, + 5932313.575, + 464234.632, + 5932318.027, + 464236.921, + 5932322.48, + 464239.211, + 5932326.933, + 464241.501, + 5932331.386, + 464243.79, + 5932335.838, + 464246.08, + 5932340.291, + 464248.37, + 5932344.744, + 464250.659, + 5932349.197, + 464252.949, + 5932353.649, + 464255.239, + 5932358.102, + 464257.528, + 5932362.555, + 464259.818, + 5932367.008, + 464262.108, + 5932371.461, + 464264.397, + 5932375.913, + 464266.687, + 5932380.366, + 464268.976, + 5932384.819, + 464271.266, + 5932389.272, + 464273.556, + 5932393.725, + 464275.845, + 5932398.177, + 464278.135, + 5932402.63, + 464280.424, + 5932407.083, + 464282.714, + 5932411.536, + 464285.003, + 5932415.988, + 464287.293, + 5932420.441, + 464289.583, + 5932424.894, + 464291.872, + 5932429.347, + 464294.162, + 5932433.8, + 464296.451, + 5932438.253, + 464298.741, + 5932442.705, + 464301.03, + 5932447.158, + 464303.32, + 5932451.611, + 464305.609, + 5932456.064, + 464307.899, + 5932460.517, + 464310.188, + 5932464.969, + 464312.478, + 5932469.422, + 464314.767, + 5932473.875, + 464317.057, + 5932478.328, + 464319.346, + 5932482.781, + 464321.636, + 5932487.234, + 464323.926, + 5932491.686, + 464326.215, + 5932496.139, + 464328.505, + 5932500.592, + 464330.794, + 5932505.045, + 464333.083, + 5932509.498, + 464335.373, + 5932513.951, + 464337.662, + 5932518.403, + 464339.952, + 5932522.856, + 464342.241, + 5932527.309, + 464344.531, + 5932531.762, + 464346.82, + 5932536.215, + 464349.11, + 5932540.668, + 464351.399, + 5932545.12, + 464353.689, + 5932549.573, + 464355.978, + 5932554.026, + 464358.268, + 5932558.479, + 464360.557, + 5932562.932, + 464362.847, + 5932567.385, + 464365.136, + 5932571.838, + 464367.426, + 5932576.291, + 464369.715, + 5932580.743, + 464372.004, + 5932585.196, + 464374.294, + 5932589.649, + 464376.583, + 5932594.102, + 464378.873, + 5932598.555, + 464381.162, + 5932603.008, + 464383.452, + 5932607.461, + 464385.741, + 5932611.913, + 464388.031, + 5932616.366, + 464390.32, + 5932620.819, + 464392.61, + 5932625.272, + 464394.899, + 5932629.725, + 464397.188, + 5932634.178, + 464399.478, + 5932638.631, + 464401.767, + 5932643.084, + 464404.057, + 5932647.536, + 464406.346, + 5932651.989, + 464408.636, + 5932656.442, + 464410.925, + 5932660.895, + 464413.214, + 5932665.348, + 464415.504, + 5932669.801, + 464417.794, + 5932674.254, + 464420.083, + 5932678.706, + 464422.372, + 5932683.159, + 464424.662, + 5932687.612, + 464426.951, + 5932692.065, + 464429.241, + 5932696.518, + 464431.53, + 5932700.971, + 464433.82, + 5932705.423, + 464436.109, + 5932709.876, + 464438.399, + 5932714.329, + 464440.688, + 5932718.781, + 464442.978, + 5932723.235, + 464445.268, + 5932727.687, + 464447.557, + 5932732.14, + 464449.847, + 5932736.593, + 464452.137, + 5932741.046, + 464454.426, + 5932745.498, + 464456.716, + 5932749.951, + 464459.006, + 5932754.404, + 464461.296, + 5932758.857, + 464463.586, + 5932763.309, + 464465.876, + 5932767.761, +] diff --git a/GrpcInterface/Python/rips/WebvizPythonExamples/grid_geometry_extraction_cut_along_polyline.py b/GrpcInterface/Python/rips/WebvizPythonExamples/grid_geometry_extraction_cut_along_polyline.py index 408450d219..2c856381b6 100644 --- a/GrpcInterface/Python/rips/WebvizPythonExamples/grid_geometry_extraction_cut_along_polyline.py +++ b/GrpcInterface/Python/rips/WebvizPythonExamples/grid_geometry_extraction_cut_along_polyline.py @@ -10,6 +10,8 @@ from rips.generated.GridGeometryExtraction_pb2 import * # from ..generated.GridGeometryExtraction_pb2_grpc import * # from ..generated.GridGeometryExtraction_pb2 import * +from drogon_grid_well_path_polyline_xy_utm import drogon_well_path_polyline_xy_utm + rips_instance = Instance.find() grid_geometry_extraction_stub = GridGeometryExtractionStub(rips_instance.channel) @@ -17,6 +19,7 @@ grid_file_name = "MOCKED_TEST_GRID" grid_file_name = ( "D:/Git/resinsight-tutorials/model-data/norne/NORNE_ATW2013_RFTPLT_V2.EGRID" ) +grid_file_name = "D:/ResInsight/GRID__DROGON_13M.roff" # Test polylines mocked_model_fence_poly_line_utm_xy = [ @@ -235,4 +238,7 @@ print(f"Total time elapsed: {total_time_elapsed} ms") for message, time_elapsed in named_events_and_time_elapsed.items(): print(f"{message}: {time_elapsed}") +print(f"Expected number of segments: {len(fence_poly_line_utm_xy) / 2 - 1}") +print(f"Number of segments: {len(fence_mesh_sections)}") + fig.show() diff --git a/GrpcInterface/Python/rips/WebvizPythonExamples/grid_geometry_extraction_get_grid_surface.py b/GrpcInterface/Python/rips/WebvizPythonExamples/grid_geometry_extraction_get_grid_surface.py index 13ab667899..1f36671066 100644 --- a/GrpcInterface/Python/rips/WebvizPythonExamples/grid_geometry_extraction_get_grid_surface.py +++ b/GrpcInterface/Python/rips/WebvizPythonExamples/grid_geometry_extraction_get_grid_surface.py @@ -13,11 +13,12 @@ from rips.generated.GridGeometryExtraction_pb2 import * rips_instance = Instance.find() grid_geometry_extraction_stub = GridGeometryExtractionStub(rips_instance.channel) -grid_file_name = ( - "D:/Git/resinsight-tutorials/model-data/norne/NORNE_ATW2013_RFTPLT_V2.EGRID" -) +# grid_file_name = ( +# "D:/Git/resinsight-tutorials/model-data/norne/NORNE_ATW2013_RFTPLT_V2.EGRID" +# ) # grid_file_name = "MOCKED_TEST_GRID" # grid_file_name = "D:/ResInsight/GRID__SNORRE_BASECASEGRID.roff" +grid_file_name = "D:/ResInsight/GRID__DROGON_13M.roff" ijk_index_filter = GridGeometryExtraction__pb2.IJKIndexFilter( iMin=15, iMax=30, jMin=30, jMax=90, kMin=1, kMax=12 diff --git a/GrpcInterface/RiaGrpcGridGeometryExtractionService.cpp b/GrpcInterface/RiaGrpcGridGeometryExtractionService.cpp index 6996b3730f..f08ab49607 100644 --- a/GrpcInterface/RiaGrpcGridGeometryExtractionService.cpp +++ b/GrpcInterface/RiaGrpcGridGeometryExtractionService.cpp @@ -429,7 +429,7 @@ std::vector RiaGrpcGridGeometryExtractionService::initAndWeldVertices const cvf::Vec3fArray& vertices ) const { // Initialize welder - const cvf::uint numBuckets = static_cast( vertices.size() ); + const cvf::uint numBuckets = std::max( static_cast( vertices.size() ), cvf::uint( 1 ) ); rWelder.initialize( m_weldingDistance, m_weldingCellSize, numBuckets ); // Weld vertices