JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. jess yan
    • Profile
    • Following 1
    • Followers 0
    • Topics 6
    • Posts 16
    • Best 0
    • Controversial 0
    • Groups 0

    jess yan

    @jess yan

    0
    Reputation
    1
    Profile views
    16
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    jess yan Unfollow Follow

    Latest posts made by jess yan

    • RE: threejs integration

      @hrgdavor This is the best idea. Treat jscad as a modeling library, and the model can work on other rendering engines.😊

      I recently tried to add the function of dimensioning to the two-dimensional model. After encapsulating the function, I can input the starting point, the end point and the type of the label to draw the label.

      截屏2021-09-29 下午6.51.29.png
      This is the input parameter of the dimension marker.

      It works fine, but i cannot select points with the mouse

      posted in General Discussions
      jess yan
      jess yan
    • RE: threejs integration

      @danmarshall I also want to change the rendering of the model from regl-renderer to threejs. Using regl-renderer is too painful! Especially threejs is more convenient in terms of interaction.

      posted in General Discussions
      jess yan
      jess yan
    • RE: How to get the coordinate value through the mouse?

      I use camera-unproject to do coordinate mapping, but the obtained coordinates are obviously wrong.

      code:

          const regl = this.$el
          const handleMouseDown = (e) => {
            const x = 1 - (e.offsetX / regl.clientWidth) * 2
            const y = (e.offsetY / regl.clientHeight) * 2 - 1
      
            const point = vec3.fromValues(x, y, 0.5)
      
            const { projection, view, viewport } = this.camera
      
            const combinedProjView = mat4.multiply([], projection, view)
      
            const invProjView = mat4.invert([], combinedProjView)
      
            const result = unproject([], point, viewport, invProjView)
      
            console.log('convasSize: ', [regl.clientWidth, regl.clientHeight])
            console.log('viewport: ', viewport)
            console.log('clickPoint: ', [x, y])
            console.log('unproject result:', result)
          }
          this.$el.addEventListener('mousedown', handleMouseDown.bind(this))
      

      4a0979ad-ef8d-4af6-80d6-b7a52f92e8f9-image.png
      Could it be that I did something wrong?

      posted in Development Discussions
      jess yan
      jess yan
    • RE: Video of an integrated tool (from 2016) using OpenJSCAD v0.4

      @gilboonet
      Hello, I watched this video. There is a point selection function in the video, I only need to do a two-dimensional dimensioning function. What I want to know is how the click function in the video maps the click position of the mouse to the coordinates in the coordinate system? I did not succeed in mapping.
      Because when the canvas moves, the origin of the coordinate system and the origin of the canvas are not the same.
      can you help me? Maybe I need some knowledge of graphics.

      posted in Comments & Feedback
      jess yan
      jess yan
    • How to get the coordinate value through the mouse?

      Hi, all! How to get the coordinates in the coordinate system through the mouse?
      cb6629d6-fb99-428a-8883-239763e85860-image.png
      When the mouse clicks here, get the clicked coordinates (1, 0).

      Maybe a method similar to Vector3 requires unproject() to complete?

      In Threejs:

      unproject( camera ) {
      
      		return this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );
      
      	}
      
      
      posted in Development Discussions
      jess yan
      jess yan
    • RE: ScriptCAD.org

      @hrgdavor
      This feature is cool and very useful. I tried to map the mouse coordinates to the canvas coordinates, but without success. Do you have the realization of this function?

      posted in General Discussions
      jess yan
      jess yan
    • RE: A questions about project()

      @z3dev
      Ok, I have submitted an issue on github.
      https://github.com/jscad/OpenJSCAD.org/issues/916

      posted in Development Discussions
      jess yan
      jess yan
    • A questions about project()

      @z3dev
      When I use project() to try to project the .stl model onto a 2d plane, the console prompts:
      截屏2021-09-27 下午2.18.08.png
      But the 3d model can be displayed normally.

      This problem does not appear in all .stl models, only complex .stl models will appear in this problem.

      I debugged and found that the cause of this problem was that poly3.toPoints() returned an empty array.
      60f9aa8e-2aea-4f4f-8f7a-72975d45abc5-image.png

      Should the empty array be filtered before calling poly3.toPoints()?

      posted in Development Discussions
      jess yan
      jess yan
    • AutoCAD Text conversion fails

      Re: V2 Deserializers (Import)

      @jscad/dxf-deserialize This library ignores the text in the dxf file when converting the dxf file into js.

      posted in Development Discussions
      jess yan
      jess yan
    • RE: How to select the rendered model with the mouse?

      @z3dev OK! If you render multiple models at the same time, you can only select the model from the list and edit the model parameters. This is the solution I thought of, although it is not perfect.

      posted in Development Discussions
      jess yan
      jess yan