JSCAD User Group
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Color lost in translation (or any operation)

    Scheduled Pinned Locked Moved Development Discussions
    4 Posts 2 Posters 1.3k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • BarbourSmithB Offline
      BarbourSmith
      last edited by

      I'm seeing some behavior which is different from what I would expect. My solids are losing their color when they are translated or operated on in any other way (ie booleans).

      Is this the desired behavior? I remember V1 working differently and I would advocate for solids holding their color through operations.

      Here's a quick example which shows the behavior in jscad.xyz

      const jscad = require('@jscad/modeling')
      const { colorize, colorNameToRgb } = jscad.colors
      const { sphere } = jscad.primitives
      const { translate } = jscad.transforms
      
      const main = () => {
        
        const colorSphere = colorize(colorNameToRgb('red'), sphere())
        
        const translatedSphere = translate([5, 0, 0], colorSphere)
        
      
        return [
          colorSphere,
          translatedSphere
        ]
      }
      
      module.exports = { main }
      

      I would expect to see two red spheres, but instead I see:

      393d8a6f-2852-4c92-9c02-a1a101715805-image.png

      Is this a bug?

      z3devZ 2 Replies Last reply Reply Quote 0
      • z3devZ Offline
        z3dev @BarbourSmith
        last edited by

        @BarbourSmith well... let's call it a feature of V2.

        colors should be added as the last step, after all operations are completed.

        1 Reply Last reply Reply Quote 1
        • z3devZ Offline
          z3dev @BarbourSmith
          last edited by

          @BarbourSmith there's an open issue about this as well.

          https://github.com/jscad/OpenJSCAD.org/issues/594

          1 Reply Last reply Reply Quote 1
          • BarbourSmithB Offline
            BarbourSmith
            last edited by

            Thanks! I'll give it a comment of support there 😀

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            Powered by NodeBB | Contributors