Coder Social home page Coder Social logo

Composite literal uses unkeyed fields about sdf HOT 5 OPEN

soypat avatar soypat commented on May 27, 2024
Composite literal uses unkeyed fields

from sdf.

Comments (5)

soypat avatar soypat commented on May 27, 2024

Hey there! I've wanted to fix this issue for some time now in this module.

That said I think adding a function to this codebase is just noise. Users should implement their code using the r2 package as is. If they prefer to solve this via a user implemented function or adding field tags,that should be up to them.

Also an opinionof mine: there should be prefferably one way of declaring an r2Vec, and to me it seems r2.Vec{} is good enough. Short and self documenting.

If you want to fix these vet errors in sdf by adding the field tags I'd be very grateful!

from sdf.

drummonds avatar drummonds commented on May 27, 2024

Ok I fixed it mostly the other way round. The regex to replace them is easier. I will have bash at doing them other way round.

from sdf.

soypat avatar soypat commented on May 27, 2024

I should really learn regexes heh. By the way, this project might interest you https://github.com/soypat/sdf3ui.

from sdf.

drummonds avatar drummonds commented on May 27, 2024

That was great and works really well. I was wondering about bringing though colours, OpenScad can do this. It works for construction objects and highlighting parts. Thanks for the star but I am deleting my effort as my printer is now printing the stacking adaptor for bowls that I was trying to create.

from sdf.

soypat avatar soypat commented on May 27, 2024

Colors are a must have for the future. I've already given it bare-minimum thought for STL generation:

// Attributes contains all model attribute data.
type Attributes struct {
    // main color
    Color color.Color
    SecondaryColor color.Color
}

// Attribute sets a single or various attributes of an Attributes type
type Attribute func(*Attributes)

// Probably worth storing this under a package, maybe helpers/attr
func AttrColor(c color.Color) Attribute {
    return func(a *Attributes) { a.Color = c }
}

// Refactor CreateSTL with non-breaking changes
func CreateSTL(path string, r Renderer, attrs ...Attribute) error {
    // loop over attrs and set a new Attributes struct
}

By the way, I'd like to warn you breaking changes are incoming as soon as gonum/gonum#1791 is resolved. This would replace the d3.Box, render.Triangle3 and d2.Box types with their respective gonum types. This change would allow users to work with the Box types freely in their code. The Triangle type would further decouple the render package and make the Renderer interface more flexible and dependable as the Triangle type would be tied to a solid, trusted and tested library.

from sdf.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.