Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hyoo-ru/mam_mol into offline2
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Dec 29, 2024
2 parents 854046d + 16487a5 commit 667e459
Show file tree
Hide file tree
Showing 81 changed files with 2,775 additions and 1,295 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/deploy.yml → .github/workflows/mol.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: $mol

on:
workflow_dispatch:
Expand Down Expand Up @@ -42,12 +42,12 @@ jobs:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
INPUTS_CLIENT_PAYLOAD: '{"repository":${{ toJson(github.event.repository.name) }}}'
INPUTS_EVENT_TYPE: dependency_changed
INPUTS_REPOSITORY: ${{ matrix.repo }}
uses: rekgrpth/github-repository-dispatch-shell-action@v1
- uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GH_PAT }}
repository: ${{ matrix.repo }}
event-type: dependency_changed
client-payload: '{"repository":${{ toJson(github.event.repository.name) }}}'
strategy:
matrix:
repo:
Expand Down
50 changes: 50 additions & 0 deletions 3d/sdf/sdf.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// min## = union
// max## = joint
// -# = inverse
// #+# = scale

float mol_3d_sdf_joint( float a, float b ) {
return max( a, b );
}
float mol_3d_sdf_joint( float a, float b, float c ) {
return max( max( a, b ), c );
}
float mol_3d_sdf_joint( float a, float b, float c, float d ) {
return max( max( a, b ), max( c, d ) );
}
float mol_3d_sdf_joint( vec3 point ) {
return mol_3d_sdf_joint( point.x, point.y, point.z );
}

float mol_3d_sdf_union( float a, float b ) {
return min( a, b );
}
float mol_3d_sdf_union( float a, float b, float c ) {
return min( min( a, b ), c );
}
float mol_3d_sdf_union( float a, float b, float c, float d ) {
return min( min( a, b ), min( c, d ) );
}
float mol_3d_sdf_union( vec3 point ) {
return mol_3d_sdf_union( point.x, point.y, point.z );
}

float mol_3d_sdf_union_smooth( float d1, float d2, float k ) {
float h = clamp( 0.5 + 0.5*(d2-d1)/k, 0.0, 1.0 );
return mix( d2, d1, h ) - k*h*(1.0-h);
}

float mol_3d_sdf_sphere( vec3 point, float size ) {
return length(point) - size;
}

float mol_3d_sdf_plane( vec3 point, vec3 normal ) {
return dot( point, normal );
}

float mol_3d_sdf_box( vec3 point, vec3 size, float round ) {
vec3 d = abs(point) - size + round;
return min( mol_3d_sdf_joint( d ), 0.0 )
+ length( max( d, 0.0 ) )
- round;
}
2 changes: 1 addition & 1 deletion base64/decode/decode.node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace $ {
export function $mol_base64_decode_node(base64Str: string): Uint8Array {
export function $mol_base64_decode_node(base64Str: string): Uint8Array< ArrayBuffer > {

base64Str = base64Str.replace( /-/g, '+' ).replace( /_/g, '/' )

Expand Down
2 changes: 1 addition & 1 deletion base64/decode/decode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace $ {
export function $mol_base64_decode(base64: string): Uint8Array {
export function $mol_base64_decode(base64: string): Uint8Array< ArrayBuffer > {
throw new Error('Not implemented')
}
}
2 changes: 1 addition & 1 deletion base64/decode/decode.web.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace $ {

export function $mol_base64_decode_web(base64Str: string): Uint8Array {
export function $mol_base64_decode_web(base64Str: string): Uint8Array< ArrayBuffer > {
return new Uint8Array($mol_dom_context.atob(base64Str).split('').map(c => c.charCodeAt(0)))
}

Expand Down
3 changes: 2 additions & 1 deletion book2/catalog/catalog.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ $mol_book2_catalog $mol_book2
<= Menu_filter $mol_search
query? <=> menu_filter? \
<= Menu_links $mol_list
Empty <= Menu_links_empty $mol_view
rows <= menu_links /
<= Menu_link*0 $mol_link
arg <= arg* *
arg <= menu_link_arg* <= arg* *
sub <= menu_link_content* /
<= Menu_link_title* $mol_dimmer
needle <= menu_filter
Expand Down
4 changes: 2 additions & 2 deletions buffer/buffer.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace $ {
export class $mol_buffer extends DataView {
export class $mol_buffer extends DataView< ArrayBuffer > {

static from<
This extends typeof $mol_buffer
>(
this: This,
array: number | string | ArrayBufferView,
array: number | string | ArrayBufferView< ArrayBuffer >,
) {
if( typeof array === 'number' ) array = new Uint8Array( array )
if( typeof array === 'string' ) array = $mol_base64_ae_decode( array )
Expand Down
Loading

0 comments on commit 667e459

Please sign in to comment.