Skip to content

Conversation

@Didou09
Copy link
Member

@Didou09 Didou09 commented Mar 15, 2025

Main changes:

  • Triangular grid:

    • add_mesh_2d_tri(crop_poly=np.ndarray) implemented !
      • properly handles removing non-needed mesh elements
    • shape-c and shape-k replaced by shape_c and shape_k
    • Fixed testing on triangular grid trifinder (now used point on grid)
  • Bsplines of deg = 2 on triangular grid:

    • add_bsplines(deg=2) operational
    • TODO: interpolation (evaluation in class)

TODO: cropbs

Issues:

Example:

ITER triangular mesh from points cloud density and Delaunay triangulation + cropping


import bsplines2d as bs2

pfe = "C:/Users/dvezinet/Documents/FromOthers/Pedro_CARVHALO/point_cloud.csv"

out = np.loadtxt(pfe, skiprows=1, delimiter=',')

conf = tf.load_config('ITER-V0')

coll = bs2.BSplines2D()

coll.add_mesh_2d_tri(pts_x0=out[:, 0], pts_x1=out[:, 1], crop_poly=conf)

dax = coll.plot_mesh()

image

And adding bsplines of deg=2:

coll.add_bsplines(deg=2)

coll
 
ref key      size  nb. data  nb. data monot.
-----------  ----  --------  ---------------
m00-nk       1363  2         0              
m00-nc       2615  3         0              
m00-nind     3     1         0              
m00_bs0_nbs  2615  2         0              
m00_bs1_nbs  1363  2         0              
m00_bs2_nbs  2315  2         0              

data         shape      ref                     dim      quant    name  units  bsplines    
-----------  ---------  ----------------------  -------  -------  ----  -----  ------------
m00_k0       (1363,)    ('m00-nk',)                                                        
m00_k1       (1363,)    ('m00-nk',)                                                        
m00_c0       (2615,)    ('m00-nc',)                                                        
m00_c1       (2615,)    ('m00-nc',)                                                        
m00-ind      (2615, 3)  ('m00-nc', 'm00-nind')  indices  indices                           
m00_bs0_ap0  (2615,)    ('m00_bs0_nbs',)                                       ('m00_bs0',)
m00_bs0_ap1  (2615,)    ('m00_bs0_nbs',)                                       ('m00_bs0',)
m00_bs1_ap0  (1363,)    ('m00_bs1_nbs',)                                       ('m00_bs1',)
m00_bs1_ap1  (1363,)    ('m00_bs1_nbs',)                                       ('m00_bs1',)
m00_bs2_ap0  (2315,)    ('m00_bs2_nbs',)                                       ('m00_bs2',)
m00_bs2_ap1  (2315,)    ('m00_bs2_nbs',)                                       ('m00_bs2',)

mesh  nd  type  crop   ntri  knots                 cents                 shape_k  shape_c  ind      subkey  nb bsplines
----  --  ----  -----  ----  --------------------  --------------------  -------  -------  -------  ------  -----------
m00   2d  tri   False  1     ('m00_k0', 'm00_k1')  ('m00_c0', 'm00_c1')  (1363,)  (2615,)  m00-ind  None    3          

bsplines  deg  mesh  ref               ref_bs            apex                            shape    crop 
--------  ---  ----  ----------------  ----------------  ------------------------------  -------  -----
m00_bs0   0    m00   ('m00_bs0_nbs',)  ('m00_bs0_nbs',)  ('m00_bs0_ap0', 'm00_bs0_ap1')  (2615,)  False
m00_bs1   1    m00   ('m00_bs1_nbs',)  ('m00_bs1_nbs',)  ('m00_bs1_ap0', 'm00_bs1_ap1')  (1363,)  False
m00_bs2   2    m00   ('m00_bs2_nbs',)  ('m00_bs2_nbs',)  ('m00_bs2_ap0', 'm00_bs2_ap1')  (2315,)  False

point_cloud.csv

@Didou09 Didou09 self-assigned this Mar 15, 2025
@Didou09 Didou09 changed the title Issue104 fix triangular Issue104 fix triangular + start bsplines deg = 2 on triangles Mar 17, 2025
@Didou09 Didou09 merged commit f2b85b4 into devel Mar 17, 2025
10 checks passed
@Didou09 Didou09 deleted the Issue104_FixTriangular branch March 17, 2025 12:35
@Didou09 Didou09 mentioned this pull request Mar 17, 2025
@Didou09 Didou09 mentioned this pull request Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants