Skip to content

Commit

Permalink
Expanded documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin-Mattheus-Moerman committed Sep 4, 2024
1 parent afd3a48 commit 435f949
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
75 changes: 75 additions & 0 deletions docs/src/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,79 @@ Comodo.scalesimplex
## `subcurve`
```@docs
Comodo.subcurve
```

## `dualclad`
```@docs
Comodo.dualclad
```

## `tet2hex`
```@docs
Comodo.tet2hex
```

## `element2faces`
```@docs
Comodo.element2faces
```

## `subhex`
```@docs
Comodo.subhex
```

## `rhombicdodecahedron`
```@docs
Comodo.rhombicdodecahedron
```

## `tri2quad`
```@docs
Comodo.tri2quad
```

## `tetgenmesh`
```@docs
Comodo.tetgenmesh
```

## `surfacevolume`
```@docs
Comodo.surfacevolume
```

## `tetvolume`
```@docs
Comodo.tetvolume
```

## `extrudefaces`
```@docs
Comodo.extrudefaces
```

## `filletcurve`
```@docs
Comodo.filletcurve
```

## `squircle`
```@docs
Comodo.squircle
```

## `circlerange`
```@docs
Comodo.circlerange
```

## `edgefaceangles`
```@docs
Comodo.edgefaceangles
```

## `faceanglesegment`
```@docs
Comodo.faceanglesegment
```
33 changes: 33 additions & 0 deletions src/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4493,6 +4493,15 @@ function subhex(E::Vector{Hex8{T}},V::Vector{Point{ND,TV}},n::Int; direction=0)
end
end

"""
rhombicdodecahedron(r = 1.0)
Creates mesh for rhombicdodecahedron
# Description
This function creates the faces `F` and vertices `V` for a rhombicdodecahedron.
The radius of the shape is set using the input radius `r`.
"""
function rhombicdodecahedron(r = 1.0)
F = Vector{QuadFace{Int}}(undef,12)
F[ 1] = [ 1, 10, 5, 9]
Expand Down Expand Up @@ -4532,7 +4541,18 @@ function rhombicdodecahedron(r = 1.0)
return F,V
end

"""
tri2quad(F,V; method=:split)
Converts triangles to quads
# Description
This function converts the input triangular mesh, defined by the faces `F` and
vertices `V`, to a quadrangulation. The method for this conversion is set using
the attribute `method` which can be set to `:split`, splitting each triangle
into 3 quads by introducing a new central node, or `:rhombic`. whereby each
triangle edge is used to construct a rhombic quadrilateral face.
"""
function tri2quad(F,V; method=:split)
# Get mesh edges
E = meshedges(F) # Non-unique edges
Expand Down Expand Up @@ -4767,6 +4787,19 @@ function extrudefaces(F::Vector{NgonFace{NF,TF}},V::Vector{Point{ND,TV}}; extent
return E, VE
end


"""
filletcurve(V::Vector{Point{NV,TV}}; rMax::Union{Vector{T},T,Nothing}=nothing, constrain_method = :max, n=25, close_loop = false, eps_level = 1e-6) where TV<:Real where NV where T<:Real
Fillets/rounds curves
# Description
The function takes in a curve defined by the points `V` and applies filleting
(or rounding) to each "corner" (i.e. a point between two neighbouring points).
The maximum radius `rMax` is used as the largest possible radius to use. If this,
radius is not possible (e.g. if input points are too close), then a lower Radius
is used.
"""
function filletcurve(V::Vector{Point{NV,TV}}; rMax::Union{Vector{T},T,Nothing}=nothing, constrain_method = :max, n=25, close_loop = false, eps_level = 1e-6) where TV<:Real where NV where T<:Real
VP = deepcopy(V)
if length(VP)>2
Expand Down

0 comments on commit 435f949

Please sign in to comment.